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 trial3 Answers
Ryan Ackermann
14,665 PointsWell 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 :)
Meek D
3,457 Pointsif 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
Ryan Ackermann
14,665 PointsActually IBAction is the return type in your example :)
Meek D
3,457 PointsRyan ackermanm you right
kerdeseverin
9,688 Points(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)