This topic created in 4692 days ago, the information mentioned may be changed or developed.
跟着 Cocoa and Objective C up and Running 这本书学习。
在做到GuestBook 时,按钮事件在tableView中新生成一行数据。数据在 AppDelegate 的 NSMutableArray *guests 中。
之前 data source 用的是重写 numberOfRowsInTableView: 等方法,没有问题。之后按书上介绍改成在IB中bind 一个 array controller 后,改动相关代码后,为什么要将
[self.guests addObject:guest] 改成
|
[[self mutableArrayValueForKey:@"guests"] addObject:guest] ??
维持原代码则无法正常运行。。。
求解!!