I have my array unique
that is my main array and my array kind
. I need to check that only 1 value of kind
is present in the array unique
. Then if there is more than 1 value of the array kind
in unique
I need to unset all values but the first one used in the array.
The further i got to achieve this is with the following code but I can not store the indexpath
of the found object to do a later comparison. xcode says "bad receiver type nsinteger"
could anyone help me to achieve this?
kind = @[@"#Routine",@"#Exercise",@"#Username"];
NSMutableArray *uniqueKind = [NSMutableArray array];
for (NSString* obj in kind) {
if ( [unique containsObject:obj] ) {
NSInteger i = [unique indexOfObject:obj];
[uniqueKind addObject: [i intValue]];
}
}