Saturday, September 15, 2012

Remove Duplicate copy from array

NSArray *arrWithAllObjects = [[NSArray alloc] initWithObjects: @"Nitin", @"Nitin",@"Aniket", @"Sachin", @"Amol", nil];
NSArray *arrWithoutDuplicate = [[NSSet setWithArray: arrWithAllObjects] allObjects];
NSLog(@"New Array With Duplicate %@", arrWithAllObjects);
NSLog(@"New Array Without Duplicate %@",arrWithoutDuplicate);

No comments:

Post a Comment