[_noteTitles addObject:@"title"];
[_noteDescriptions addObject:@"description"];
[self.tableView reloadData];
NSLog(@"%@", [_noteDescriptions description]);
NSLog(@"%@", [_noteTitles description]);
在这些行之前,我合成了“_noteDescription”,“_ noteTitles”。当调用NSLog行时,在控制台上我得到两个数组的“(null)”。这个函数将被多次调用(不经常)来更新表的内容,但是现在数组没有被填充。
答案 0 :(得分:5)
看起来你不初始化你的数组。因此,您要向addObject:
发送nil
,但没有任何反应。这也解释了为什么NSLog()
打印(null)
。
请注意@synthesize
为您的媒体资源生成访问者,不初始化支持实例变量。