Re: Should I use delegates or accessors?
Re: Should I use delegates or accessors?
- Subject: Re: Should I use delegates or accessors?
- From: Shawn Erickson <email@hidden>
- Date: Tue, 26 Dec 2006 08:05:11 -0800
On Dec 26, 2006, at 7:21 AM, Alan Smith wrote:
It would be for changing the image that the class uses.
[control setImage: image];
or
- (id)imageForControl:(MyClass*)control
{
return image;
}
The delegate would be sent the imageForControl: when the class is
doing its drawing.
If there is no delegate, or it doesn't respond to that selector, than
the class could/would fall-back on the image set with setImage:.
In this case setImage: / image accessors should be sufficient. Also
it would avoid calling out during drawing which you often want to
take place quickly as possible.
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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