Xcode application menu items

I am creating a simple application in xcode 3 but donโ€™t know how to encode appmenu elements. I have some simple elements that need codes - open and print. Closing and minimizing are done automatically. Can someone tell me how to program these elements so that they can be activated in the application?

+1
xcode cocoa menu
source share
1 answer

basically you need to declare your actions / functions as IBActions so that you can link them in Interface Builder.

for example, you declare the following functions:

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

IBAction is just zero, but it tells the interface builder that it is available for binding. The sender (id) tells Xcode which object caused the action.

It's hard to explain without screenshots, but here's a quick tutorial for you: http://juliuspaintings.co.uk/cgi-bin/paint_css/animatedPaint/002-MenuApp.pl

+3
source share

All Articles