尝试从临时的本地 NSMutableDictionary (tmpDict) 填充 NSMutableDictionary (listContent),但 listContent 的 init 似乎失败了,因此,来自 tmpDict 的内容无法被带入。我究竟做错了什么?
谢谢
我的 .h 文件中的声明
// .h
NSMutableDictionary *listContent;
...
@property (nonatomic, strong) NSMutableDictionary *listContent;
实施文件
- (void)viewDidLoad
{
NSMutableDictionary *tmpDict = [[NSMutableDictionary alloc] init];
//-- populating tmpDict here ....
//Bring to life, this dictionary
self.listContent = [NSMutableDictionary new];
//--- self.listContent is still not alive
if(!self.listContent)
NSLog(@"listContent is not alive, yet");
//populate self.listContent with contents of tmpDict
[self.listContent addEntriesFromDictionary:tmpDict];
//--- self.listContent is still not alive
if(!self.listContent)
NSLog(@"listContent is not alive, yet");
}