【发布时间】:2013-03-11 11:18:06
【问题描述】:
我正在使用可可绑定、NSArrayController 和核心数据。 刚启动后,应用程序必须获取第一项,我在 applicationDidFinishLaunching 中尝试:
1. Entity *ent = arrayManager.arrangedObjects[0];
2. Entity *ent = arrayManager.selectedObjects[0];
---> 错误表示数组为空。为什么?
我不明白的另一件事是,当应用程序出现时,在 tableView 中有一个选定的行,但是当我记录这个时:
NSLog(@"selected row in applicationDidFinishLaunching = %li",self.TableViewController.tableView.selectedRow);
log: -1 --> 没有选择行!为什么?
【问题讨论】:
-
所以
arrangedObjects返回结果但selectedObjects不返回?
标签: macos cocoa-bindings nsarraycontroller