添加新对象时 CPArrayController 不更新
问题 卡布奇诺应用程序最初加载成功。在进行 ajax 调用并且用 JSON 对象填充数组后,数组控制器无法识别它并填充数据。
设置 使用 capp 和 xcc 的最新版本。我有一个应用程序,其中所有 IB 元素都绑定到 NSArrayController。它绑定到我的 AppController 的 CPMutableArray。我导入一个触发并处理 AJAX 调用的控制器类。我已确认完成后我的 CPMutableArray 已填充数据。
这只是通过一个简单的“addObjectsFromArray”完成的
那么我是否应该通知 ArrayController 重新加载或遵循自动获取更改的过程?
Problem
Cappuccino app initially loads successfully. After an ajax call is made and an array is populated with JSON Objects, the Array Controller doesn't recognize it and populate the data.
Setup
Using the latest build from capp and xcc. I have an application where all of the IB elements are tied to an NSArrayController. It's bound to my AppController's CPMutableArray. I Import a controller class that fires off and handles the AJAX call. I have confirmed when it has finished that my CPMutableArray is populated with data.
This is just done with a simple "addObjectsFromArray"
So am I supposed to notify the ArrayController to reload or follow a procedure where it automatically picks up the changes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一旦我执行了以下操作,我就能够成功更新页面:
将我的 CPMutableArray 变成 CPArrayController。由于我只是添加和删除对象,因此代码中的其他位置并未发生更改。我最大的问题是依赖./bootstrap.sh。它不会安装和配置所有内容。克隆 github /cappuccino/cappuccino 并运行 Jake Install。现在 xcode 正在接收我的 Outlet 和 ibactions!
I was able to successfully update the page once I did the following
Made my CPMutableArray into a CPArrayController. Since I am only adding and removing objects it hasn't beexn a change elsewhere in the code.My biggest problem was relying on ./bootstrap.sh. It doesn't install and configure everything. Cloned the github /cappuccino/cappuccino and ran Jake Install. Now xcode is picking up my outlets and ibactions!