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 trial

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 {
       NSLog(@"Test");
}

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)