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
NSString Examples in one
Inheritance Example
NSString & MutableNSString Examples in one
Class implementation
Simple Arithmetic Operations in Objective C
Program 2.2
datatype
bookinheritence
Az Flights Optimization
geomatric operations in objective c