Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
NSMutableset(add/remove,Etraction,Intersect)
//gcc 5.0.4 #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; //creating Mutable Set NSMutableSet *reparing= [NSMutableSet setWithObjects:@"Ferrari",@"Lamborghini",nil]; NSMutableSet *repaired= [NSMutableSet setWithObjects:@"BMW",@"AUDI",@"RR",nil]; NSMutableSet *resell= [NSMutableSet setWithObjects:@"RR",@"Tesla",@"BMW",nil]; NSMutableSet *sold= [NSMutableSet setWithObjects:@"Ford",@"Jaguar",nil]; NSMutableSet *result = [NSMutableSet setWithCapacity:10]; NSLog(@"Repairing:%@",reparing); NSLog(@"repaired:%@",repaired); //Etration for( NSString *Reparing in reparing ) { NSLog(@"%@",Reparing); } //Add/Remove Object [reparing removeObject:@"Ferrari"]; [repaired addObject:@"Ferrari"]; NSLog(@"Repairing:%@",reparing); NSLog(@"repaired:%@",repaired); //intersection [result setSet:resell]; [result intersectSet:reparing]; NSLog(@"result:%@",result); [pool drain]; return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
HAL is IBM
main.m
acquire-lock
basic objective c
fullname
string
basic arithmatic Opreation in objective C
Etudiant.h
shape example
NSString & MutableNSString Examples in one
stackse - search stackoverflow differently
Please log in to post a comment.