i got this exception:
[__NSArrayI replaceObjectAtIndex:withObject:]: unrecognized selector sent to instance
when i try to replace a specific element by another:
EDIT: this is my whole code:
//declaring an AppDelegate instance
AppDelegate *myAppDelegate=(AppDelegate *)[[UIApplication sharedApplication]delegate];
//get the array in which we have stored all the choosed themes
NSMutableArray *aMutableArray=myAppDelegate.themesChoosed;
for (int i=0; i<[aMutableArray count]; i++) {
NSString *str=[NSString stringWithString:[aMutableArray objectAtIndex:i]];
if ([str isEqualToString:@"B1"]) {
[aMutableArray replaceObjectAtIndex:i withObject:@"B2"];
}
}
I maked sure that the B1 element does exist in the array.