https://github.com/Kitware/CMake
Raw File
Tip revision: ee1c6a5b0674b77a05c84ac208044f79d25826e5 authored by David Cole on 08 July 2011, 11:12:50 UTC
CMake 2.8.5
Tip revision: ee1c6a5
objc++.mm
#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;
}
back to top