i have this code :
NSMutableArray *arr = [NSMutableArray array];
for (int i = 0; i <[titleNews count]; ++i) {
TFHppleElement *someText =[titleNews objectAtIndex:i];
NSString *result = [someText content];
[arr addObject:result];
if ([[arr objectAtIndex:i]isEqualToString:@"-- : --"]) {
[arr replaceObjectAtIndex:i withObject:@"x"];
[arr addObject:@"/"];
}
NSLog(@"%@",[arr objectAtIndex:i]);
}
the (replaceObjectAtIndex: withObject:) work fine but the (addObject)method not working
NSLog(@"%@", arr);after the closing}of your loop, to see what's in the array where. You'll be surprised.