i tried doign this: Values = [[NSSet setWithArray:Values] allObjects];
and no sucess,
Thanks
i tried doign this: Values = [[NSSet setWithArray:Values] allObjects];
and no sucess,
Thanks
Your method should work, except it returns an NSArray instead of NSMutableArray. You could use
[values setArray:[[NSSet setWithArray:values] allObjects]];
to set values
to the content of the new array.
Note that the NSSet method may remove any order you have in your NSArray. You might want to loop thru your array to keep the order. Something like this:
NSMutableArray* uniqueValues = [[NSMutableArray alloc] init];
for(id e in Values)
{
if(![uniqueValues containsObject:e])
{
[uniqueValues addObject:e];
}
}