Re: Delegates - I give up
Re: Delegates - I give up
- Subject: Re: Delegates - I give up
- From: "I. Savant" <email@hidden>
- Date: Mon, 21 Jan 2008 09:42:10 -0500
On Jan 21, 2008, at 5:53 AM, William Squires wrote:
Okay, I'm beginning to think the whole "delegate" system needs some
help.
That's a rather bold, sweeping assertion. It's also a poor way to
approach a technical list for help. Step back, swallow your pride, and
be willing to consider that thousands of developers use "the whole
delegate system" reliably every day and that the problem is that
you're missing something instead of assuming it's the API's fault.
Namely, they don't seem to be self-documenting. In REALbasic, if one
wants to know what a "control" can do, examine its events in the
code editor window. You can then put code there to handle that event.
I may be mistaken (it's been a long time since I took my brief look
at REALbasic), but all you get are the names of the 'events' and maybe
a brief description and the UI controls themselves are very basic. You
still have to go to the documentation to read details. Also, comparing
Cocoa's AppKit to REALbasic is a bit silly when you consider that
REALbasic is intended for much simpler programming tasks (it really is
"real basic").
But with delegates, how do you find out (easily) what delegates a
control has, short of going to XCode help/documentation?
Yes? You're trying to develop software with a huge and rich API and
you're complaining that you have to read the manual? If that's a show-
stopper for you, you're in the wrong business (or hobby).
AppKit and Cocoa in general are far more complicated (because
they're far more flexible and extensible) than anything REALbasic
could ever hope to offer. The required reading is quite a bit heavier.
Don't get me wrong - REALbasic and its peers have their place, but
that place is not among feature-rich, complete, native APIs. Such APIs
have objects with a far more complex nature than fits into a simple
"property" or "event/action" category. Quite simply put, you no choice
but to 'RTFM'.
And, more to the point, where to put the delegate methods?
Is there a better paradigm for thinking about controls/delegates?
If so, please clue me in!
And, for that matter, what's the difference between a delegate and
an action? (besides the fact that you can connect actions in IB)
Speaking of RTFM, there was just a thread recently on this list
(where someone was complaining about the documentation but failed to
actually take the time to read it) wherein most of the questions the
OP had were answered by the *introductory* material. He was trying to
run before he learned to walk as you are trying to do:
Cocoa Fundamentals Guide - Delegates & Data Sources
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/chapter_6_section_4.html
This, I believe, answers all of your questions above, all in one
handy page. Five minutes of reading if that. I suggest not stopping
there. Nor simply starting there. I suggest reading that entire guide
thoroughly. It's not terribly long (it'd take less time to read it
than you'd spend trying to figure out what you're doing wrong, I'd
bet). Even experienced developers need to read the introductory
material to a new API.
In any case, this may also help you:
CocoaDevCentral: Extend with Delegates
http://cocoadevcentral.com/articles/000075.php
Good luck and happy reading.
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden