0

尝试从临时的本地 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");


}
4

1 回答 1

0

从 LLDB 切换到 GBD 解决了这个问题。问题是我的字典在初始化并填充对象后被 LLBD 报告为 nil。一旦我切换到 GBD,一切都被正确初始化和补充。

于 2012-05-23T11:14:46.673 回答