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
arary
Etudiant.h
string replace
Class implementation using get method
find maximum in objective c
geomatric operations in objective c
Obj C Program Structure
NSArray Method Exercise
NSMutable Example
main.m