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! While you're at it, check out some resources Treehouse students have shared here.
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 trialMichaela Fraser
165 PointsWhere should 'IBAction' be placed as the "return type"?
I am very new to this and unsure of the terminology.
2 Answers
Steve Hunter
57,712 PointsSorry, 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:
-(IBAction)buttonPressed{
}
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!!
Cheers,
Steve.
Steve Hunter
57,712 PointsI'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?
Cheers,
Steve.