应用程序菜单项Xcode [英] Application Menu Items Xcode

查看:127
本文介绍了应用程序菜单项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?

推荐答案

基本上你需要声明

例如,您声明的函数如下:

for example, you declare you functions like:

-(IBAction) doSomething:(id)sender{
 //do something code here
}

IBAction实际上只是一个nil,但它告诉Interface构建器这是可用于链接。 (id)发件人告诉XCode哪个对象触发了操作。

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.

很难解释没有截图,但这里是一个快速教程:
http://juliuspaintings.co.uk/cgi-bin/paint_css/animatedPaint/ 002-MenuApp.pl

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

这篇关于应用程序菜单项Xcode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆