NSMutableArray是零.为什么?

Sma*_*ree 0 iphone objective-c nsarray

我添加对象后,NSMutableArray它变成了nil(我检查了NSLog)


guests = [[NSMutableArray alloc]init];
guests = [localDictionary objectForKey:@"guestsArray"];

[guests addObject:@"1"];
[guests addObject:@"12"];
[guests addObject:@"31"];

if(guests == nil)
{
    NSLog(@"WHY?");
}
Run Code Online (Sandbox Code Playgroud)

你知道为什么会这样吗?我该怎么检查?

aka*_*kyy 8

这是因为[localDictionary objectForKey:@"guestsArray"]是零.