Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
NSSet ex
//gcc 5.0.4 #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSSet *stationary = [NSSet setWithObjects: @"pen", @"book", @"marker", @"pencil",nil]; NSSet *available = [NSSet setWithObjects: @"pen", @"book", @"marker", @"pencil",nil]; NSSet *purchased = [NSSet setWithObjects: @"marker", @"pencil",nil]; NSLog(@"%li", [stationary count]); for(id item in stationary){ NSLog(@"%@", item); } if([available isEqualToSet:stationary]){ NSLog(@"equal"); } if([available intersectsSet:stationary]){ NSLog(@"interset"); } /* if([available isSubsetFoSet:stationary]){ NSLog(@"subset"); }*/ if([stationary containsObject:@"marker"]){ NSLog(@"contain"); } NSSet *allsetas = [available setByAddingObjectsFromSet:purchased]; NSLog(@"%@", allsetas); [pool drain]; return 0; }
run
|
edit
|
history
|
help
0
Obj C Program Structure
Az Flights Optimization
Class implementation
string mutable
size of datatypes in objective c
primitive datatypes objective c
objective c fibonanci
geomatric operations in objective c
NSString Examples in one
find maximum in objective c