Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Simple iPhone App (iOS7) Getting Started Assign String to a Label

Michaela Fraser
Michaela Fraser
165 Points

Where should 'IBAction' be placed as the "return type"?

I am very new to this and unsure of the terminology.

2 Answers

Sorry, I just noticed you're in a code challenge ...

The return type is specified in parentheses prior to the method name. That's about as clear as mud, I know! The code you're after is:


The method is called buttonPressed, when it is called/run/used (whatever) it runs the code within the curly braces - there's none there at the moment. When that code is run, the result should create an IBAction which is then returned by the method - that's the bit before buttonPressed - the method creates an 'answer' of the type IBAction.

I hope that makes sense!!



I'm new too - welcome to Treehouse; it's a great place to learn, I find.

What exactly are you after here? The IBAction is usually assigned by dragging from the storyboard into the header file, I think.

What are you trying to do and what's not working?