I have an NSMutableArray. I have synthesized it as well. I am adding objects to it from a method by xml extraction of some file names etc. Now in my array there is the occurrence of same elements multiple times. I need to eliminate the multiple objects and get only unique ones. How can this be done? I tried the code below but then there arise some errors.
NSString *AName = [CompleteFileName_string1 substringWithRange:ArtistRange];
[array_artist addObject:AName];
for(int i=0; i < [array_artist count]; i++)
{
if([[array_artist objectAtIndex:i] isEqualToString:[array_artist objectAtIndex:i+1]])
{
[[array_artist objectAtIndex:i+1]=NULL];
}
else
{
}
}
EDIT*** i need to eliminate by ignoring case sensitivity too…
Take a tempArray as golbally
When you are adding objects from XML you have to just check