Re: Can I talk about iPhone SDK/API?
Re: Can I talk about iPhone SDK/API?
- Subject: Re: Can I talk about iPhone SDK/API?
- From: "Hank Heijink (Mailinglists)" <email@hidden>
- Date: Tue, 24 Nov 2009 10:38:01 -0500
On Nov 24, 2009, at 10:11 AM, lbland wrote:
> On Nov 24, 2009, at 9:34 AM, Alexander von Below wrote:
>
>> In Cocoa Touch applications, an action method can take one of three forms, shown here:
>>
>> - (IBAction)respondToButtonClick;
>> - (IBAction)respondToButtonClick:(id)sender;
>
> So, I have to ask, what is the practical value of having an action method with no argument? It couldn't be time savings because just checking to see the selector signature, or storing the selector signature type, takes time or memory. Is there any reason to use one form v.s. the other other than the obvious that if sender is not used then why have it around?
In short, no. It's a convenience, but it does make your intention clear that you're not interested in who sends the message, making for code that's more to the point. I think the idea is that the starting point is the method without arguments. Then, if you need more information, you add the sender, and if you need even more, you add the event.
> I know this thread changed to API, but I don't want to switch to another mail list (not yet anyways).
This would have been an excellent time to switch to cocoa-dev, since you're asking a question that has nothing to do with Xcode and everything with Cocoa, so why not?
> I know I have had discussions for over fifteen years (with Apple engineers and others) about many action signatures, but the ideas vary. I hope this question is not in a manual anywhere in the five trillion web sites on the net. My apologies in advance if I am asking a stupid question or a question that is answered somewhere else.
There are many web pages (and threads on this list) that talk at length about which questions to ask and how to ask them. When in doubt, check those. If all else fails, I suggest looking at the following: http://www.youtube.com/watch?v=dQ7tIfWD_FM.
Cheers,
Hank
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden