ios - How to remove duplicates in an array by using only one for loop? -
nsarray *inputarray = @[11, 45, 54, 32, 11, 56, 45, 76, 23, 87, 54, 45]; nsarray *outputarray = @[11, 45, 54, 32, 56, 76, 23, 87];
how can achieve in objective c without sorting, because sorting using 1 for
loop.
try this:
nsarray *inputarray = @[11, 45, 54, 32, 11, 56, 45, 76, 23, 87, 54, 45]; nsarray *outputarray = [inputarray valueforkeypath:@"@distinctunionofobjects.self"];
hope helps!!
Comments
Post a Comment