summaryrefslogtreecommitdiffstats
path: root/Tests/ObjC++/objc++.mm
blob: b7ec4b5f59c95c35c1f4c6ca1d2fc7797f02c211 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#import <iostream.h>
#import <Cocoa/Cocoa.h>

int main()
{
  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   
  NSMutableSet *mySet = [NSMutableSet set];
  cout<<"Adding values to the set."<<endl;
  [mySet addObject:[NSNumber numberWithInt:356]];
  [mySet addObject:[NSNumber numberWithInt:550]];
  [mySet addObject:[NSNumber numberWithInt:914]];

  cout<<"The set contains "<<[mySet count]<<" objects."<<endl;
  if ([mySet containsObject:[NSNumber numberWithInt:911]])
    cout<<"It's there!"<<endl;
  else
    cout<<"It's not there."<<endl;

  [pool release];
  return 0;
}