Cocoa CoreData 和非基于文档的应用程序
我有一个让我发疯的问题...... 我想“编写”一个 Cocoa CoreData 应用程序,“写”不是确切的术语,因为应用程序应该使用绑定创建。
创建基于文档的应用程序没有问题,它工作得很好。 但我想要一个非基于文档的应用程序,所以我想“像在基于文档的应用程序中一样”,但如果我这样做,应用程序就不会启动。 XCodes 的 GDB 说:
2010-07-14 11:02:39.894 nonDocBased[1242:a0f] An uncaught exception was raised
2010-07-14 11:02:39.899 nonDocBased[1242:a0f] [<NSApplication 0x100408e90> valueForUndefinedKey:]: this class is not key value coding-compliant for the key managedObjectContext.
2010-07-14 11:02:39.902 nonDocBased[1242:a0f] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSApplication 0x100408e90> valueForUndefinedKey:]: this class is not key value coding-compliant for the key managedObjectContext.'
所以我用谷歌搜索了这个,但没有发现任何有用的东西(或者可能我太缺乏经验了......)。 但我找到了一个教程(http://www.raywenderlich.com/ 934/core-data-tutorial-getting-started)并在没有绑定的情况下尝试过,但这都不起作用。
所以我的问题是如何使用核心数据创建非基于文档的应用程序?
这是我的代码,密码是stackoverflow。
感谢您的任何想法... 丹尼斯
i have a Problem wich drives me crazy...
I want to "write" a Cocoa CoreData Application, write is not the exact term, because the Application should be created with Bindings.
It was no Problem to create a Document-Based Application, it works fine.
But i want a Non-Document-Based Application, so I thought "Do the same like at the Document-Based App", but if I do so the Application do not start. XCodes' GDB says:
2010-07-14 11:02:39.894 nonDocBased[1242:a0f] An uncaught exception was raised
2010-07-14 11:02:39.899 nonDocBased[1242:a0f] [<NSApplication 0x100408e90> valueForUndefinedKey:]: this class is not key value coding-compliant for the key managedObjectContext.
2010-07-14 11:02:39.902 nonDocBased[1242:a0f] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSApplication 0x100408e90> valueForUndefinedKey:]: this class is not key value coding-compliant for the key managedObjectContext.'
So I googled on this, but found nothing helpful (or probably I was just too unexperienced... ).
But I found a Tutorial (http://www.raywenderlich.com/934/core-data-tutorial-getting-started) and tried it without Bindings but this neither works.
So my Question is how do I create a Non-Document-Based Application using Core Data?
Here's my Code, the Password is stackoverflow.
Thanks for any Ideas...
Dennis
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将 NSArrayController ManagedObjectContext 绑定到您的 AppDelegate,而不是文件的所有者。
Bind the NSArrayController managedObjectContext to your AppDelegate not to Files's owner.