如何从 Xcode 4 中的实体创建用户界面?
我已经用核心数据进行了几天的实验,并且在过去的几个小时里尝试找出如何从 xcode 4 中的实体创建 UI。根据我一直在阅读的书籍,您必须选择将核心数据实体拖到界面生成器中的窗口中,但是当我在 xcode 4 中执行此操作时,没有任何反应。 苹果文档没有任何帮助,因为它还没有针对 xcode 4 进行更新。 我确信这是非常明显的事情,但我就是无法弄清楚。
I've been experimenting with core data for a couple of days and have spent the past couple of hours trying to work out how to create a UI from an entity in xcode 4. According to the books I've been reading you have to option drag the core data entity into a window in interface builder but when I do this in xcode 4, nothing happens.
The apple documentation has been no help since it hasn't been updated for xcode 4.
I'm sure it's something really obvious but I just can't figure it out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的问题对我来说恰逢其时,因为我最近开始学习 Mac / Cocoa 开发并遇到了同样的问题。
查看文档、搜索 Google、尝试所有 Xcode 菜单选项并使用所有可能的鼠标和鼠标后,我能想到的键盘快捷键我得出的结论是,不可能调用向导从 Xcode 4 中的实体生成界面。
这回答了您的问题,但给您带来了与我相同的问题 - 您去哪里现在?
这就是我为让我的应用程序正常工作所做的事情(请注意,Erik Aigner 链接的视频中也对此进行了解释):
显然,这仅适用于非常基本的场景,但应该足以让您开始(如果您正在阅读与我相同的书,那么当您尝试绑定到相关实体时,请准备好在下一章中再次打破一切!)。
我的知识仍然存在一些差距,因为我只学习了 Core Data 2 天(Cocoa / Objective-C 学习了不到一周),所以如果上面的任何信息是错误的,那么 Cocoa 专家应该让我知道了,我会相应地更新我的帖子。
Your question is perfectly timed for me as I recently started learning Mac / Cocoa development and have come across the same problem.
After looking at the documentation, searching Google, trying out all Xcode menu options and playing around with every possible mouse & keyboard shortcut I could think of I have come to the conclusion that it is not possible to invoke the wizard to generate your interface from your entities in Xcode 4.
This answers your question but leaves you with the same issue I had - Where do you go now?
This is what I did to get my application to work (note that this is also explained in the videos linked to by Erik Aigner):
Obviously this only caters for a very basic scenario but should be enough to get you started (If you're reading the same book as me then be prepared for everything to break again in the next chapter when you try binding to related entities!).
There are still a few gaps in my knowledge as i've only been learning Core Data for 2 days (and Cocoa / Objective-C for less than a week) so if any of the information above is wrong then the Cocoa experts should let me know and I will update my post accordingly.