0

一時的なローカル NSMutableDictionary (tmpDict) から NSMutableDictionary (listContent) を作成しようとしていますが、listContent の初期化が失敗しているようで、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 に答える