appdata.items est un objet NSMutableArray.à propos de removeObjectAtIndex
code source
-(void)deleteAppDataItemId:(NSInteger)identifier{
NSLog(@"%@", [appdata.items objectAtIndex:identifier]);
NSLog(@"%i", identifier);
[appdata.items removeObjectAtIndex:identifier];
}
journal
2009-11-08 21:53:01.683 xxx[14283:207] (
200,
"",
2009-11-08 21:52:53 +0900
)
2009-11-08 21:53:01.684 xxx[14283:207] 0
2009-11-08 21:53:01.685 xxx[14283:207] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0)'
Ce qui a causé cette erreur?
Pouvez-vous également enregistrer un compte [appdata.items]. Il semble que appdata.items est vide. – diederikh
Il s'agit du journal [appdata.items count]. 2009-11-08 22: 23: 51,861 xxx [14387: 207] 1 – marcy
Y a-t-il d'autres parties de votre application modifier appdata.items dans un autre thread? – diederikh