Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
NSSet(Create,Enumrate,Compare,Checking,Combine)
//gcc 5.0.4 #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; //NSSet Creation NSSet *stationary = [NSSet setWithObjects:@"pen",@"book",@"pencil",@"marker",nil]; //Enumrating set for(id item in stationary){ NSLog(@"%@",item); } //Compare NSSet *avail = [NSSet setWithObjects:@"pen",@"book",nil]; if([avail isEqualToSet:stationary]){ NSLog(@"It's Equal."); } else { NSLog(@"Not Equal."); } //Checking NSSet *check = [NSSet setWithObjects:@"marker",nil]; if([check containsObject:@"marker"]){ NSLog(@"It Contains %@",check); } else { NSLog(@"It Doesn't Contain %@",check); } NSSet *all = [avail setByAddingObjectsFromSet: check]; NSLog(@"%@",all); [pool drain]; return 0; }
run
|
edit
|
history
|
help
0
Ex of String methods
Obj C Program Structure
03 Muestra enteros y flotante
enheritance
NSSet Program in objectice-c
simple inheritance in objective c
NSMutable Chirag
find simple Interest in objective c
string replace
Program 2.2