Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

Ben Howell
Ben Howell
1,359 Points

What is an IBAction return type?

Please help i am stuck on this challenge!

3 Answers

Well instead of giving you the answer, lets look at how to create a method with a void return type.

- (void) thisMethodIsATest {

Notice that the - (void) section of the method denotes it as a voided method, or a method without a return type.

I hope this helps :)

if you are saying like in this example - (IBAction)button:(id)sender { } it doesnt return anything ,you just assign the button do an action Ben Howell

Actually IBAction is the return type in your example :)

Ryan ackermanm you right

(IBAction)button:(id)sender { }

  • It takes in the sender ( basically whoever triggered the method)
  • It returns IBAction ( the type of action that took place e.g touch up inside)