应用程序菜单项 Xcode
我正在 xcode 3 中构建一个简单的应用程序,但不知道如何对应用程序菜单项进行编码。我有一些需要代码的简单项目 - 打开并打印。关闭和最小化是自动完成的。谁能告诉我如何对这些项目进行编程,以便它们可以在应用程序中执行?
I am building a simple app in xcode 3, but don't know how to code the appmenu items. I have a few simple items that need codes - open and print. Close and minimise are done automatically. Can anybody tell me how to programme these items so that they can be actioned in the app?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基本上,您需要将操作/函数声明为 IBActions,以便可以在 Interface Builder 中链接它们。
例如,您声明您的函数如下:
IBAction 实际上只是一个 nil,但它告诉接口构建器这可用于链接。 (id)sender 告诉 XCode 哪个对象触发了该操作。
没有屏幕截图很难解释,但这里有一个快速教程:
http://juliuspaintings.co.uk/cgi-bin/paint_css /animatedPaint/002-MenuApp.pl
basically you need to declare you actions/functions as IBActions so you can link them in the Interface Builder.
for example, you declare you functions like:
The IBAction is really just a nil, but it tells the Interface builder that this is available for linking. The (id)sender tells XCode which object triggered the action.
Hard to explain without screenshots, but here is a quick tutorial for you:
http://juliuspaintings.co.uk/cgi-bin/paint_css/animatedPaint/002-MenuApp.pl