EDIT: Updated code to better reflect my problem.
this code returns 9 lines in badDestination1
NSMutableArray* goodDestination1 = [NSMutableArray array];
NSMutableArray* badDestination1 = [NSMutableArray array];
NSMutableArray* badDestination2 = [NSMutableArray array];
for (NSString* item in sourceArray)
{
if ([item rangeOfString:@"<b>"].location != NSNotFound)
[goodDestination1 addObject:item];
else {
[badDestination1 addObject:item];
}
}
This code returns 1 value badDestination2
for (NSString* item in sourceArray)
{
if ([item rangeOfString:@"<b>"].location != NSNotFound)
[goodDestination1 addObject:item];
else {
[badDestination2 addObject:@"String"];
}
}
Does anyone know what is going on? It seems that "String" can be rewritten in the same place in the array?
source
share