Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mobidev

macrumors member
Original poster
Nov 20, 2009
40
0
Hi,


I got a basic doubt regarding the selectors of the button (uibutton) action.

i) I had observed that selector method can be used without having the declaration in the .h file. Is there any logic behind the frame work of iphone sdk in this matter.

ii) Also, return values I have seen are IBAction, id and void. Where does the actual value is returned, and how can we use the returned id value.

Can any one please make the Basic questions clear..

Thanks.
 
i) I had observed that selector method can be used without having the declaration in the .h file. Is there any logic behind the frame work of iphone sdk in this matter.
Yes, the logic is all related to whether a method is made public or not, and has much more to do with basic Objective-C than the iPhone SDK.

ii) Also, return values I have seen are IBAction, id and void. Where does the actual value is returned, and how can we use the returned id value.
Where have you seen an action method return an id? Do you have a link?
 
ii) Also, return values I have seen are IBAction, id and void. Where does the actual value is returned, and how can we use the returned id value.


IBAction is actually a special keyword that interface builder uses to know which methods you want to connect to in your header. The definition of IBAction is void. You can verify this by checking the header file or apple documention. So you may see either IBAction or void.

Are you coming from Visual Basic?
 
Yes, the logic is all related to whether a method is made public or not, and has much more to do with basic Objective-C than the iPhone SDK.


Where have you seen an action method return an id? Do you have a link?

I actually have seen in some code on the sites... didn't remember exactly. They used to return self from the selector.
 
Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C5115c Safari/6533.18.5)

Were they init methods?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.