https://github.com/Kitware/CMake
Raw File
Tip revision: 902ab6b5652a1858762696b8271c5a52e29aa041 authored by Brad King on 06 November 2012, 16:24:28 UTC
CMake 2.8.10.1
Tip revision: 902ab6b
objc++.mm
#import <Cocoa/Cocoa.h>
#import <iostream>
using namespace std;

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