Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
847 views
in Technique[技术] by (71.8m points)

objective c - How do I add an action or outlet to a class in Xcode 4.3.1?

I'm following a slightly outdated the guide from cocoalab.com (Become An Xcoder) to learn the basics of cocoa, but I'm stuck on one of the instructions.

On page 45 (section 08:9) in the section titled "Creating connections", it tells me to select the instance of my new class, and from the identity inspector, to add two actions and an outlet.

I'm using Xcode 4.3.1 which is obviously a bit different to the version that this tutorial was written for, but I can't figure out how to do the equivalent in this newer version.

Can anyone please help by giving me step by step instructions of how to add these to my object.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Open the Assistant Editor (red rectangle in the screenshot). Then, from Interface Builder, press the ctrl key and drag the mouse from the button (or an other control in you view) to the .h file.

enter image description here

You will be prompted to choose the type of the connection to create as in the screenshot below:

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...