私はこのコードでsigarbtを取得しています
if (![newPlayerName isEqual:@""] && !thereAreJustSpaces)
{
NSDictionary *player = [NSDictionary dictionaryWithObjectsAndKeys:
newPlayerName, @"name", @"", @"email", nil];
[self.playerNames addObject:player];//Getting sigarbt over here.
}
これが私のコンソール出力です
2013-03-26 08:44:30.683 ChooseTeams[3921:15203] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[__NSCFArray insertObject:atIndex:]: mutating method sent to immutable object'
*** First throw call stack:
(0x1655022 0xfcdcd6 0x15fda48 0x15fd9b9 0x164eda8 0x164ecb0 0x43f9 0x1656e99 0x13314e 0x371a0e 0x1656e99 0x13314e 0x1330e6 0x1d9ade 0x1d9fa7 0x1d9266 0x1583c0 0x1585e6 0x13edc4 0x132634 0x17e8ef5 0x1629195 0x158dff2 0x158c8da 0x158bd84 0x158bc9b 0x17e77d8 0x17e788a 0x130626 0x26dd 0x2605 0x1)
terminate called throwing an exception(lldb)
私は財産を持っています
@property (strong, nonatomic) NSMutableArray *playerNames;
およびviewDidLoadで
self.playerNames = [[NSMutableArray alloc] init];