Re: drawRect using a Category
Re: drawRect using a Category
- Subject: Re: drawRect using a Category
- From: David Duncan <email@hidden>
- Date: Sat, 31 Mar 2012 07:24:59 -0700
On Mar 30, 2012, at 8:31 PM, Peter Teeson <email@hidden> wrote:
> In a Document app I have an NSMatrix. I only need to override drawRect.
> Rather than using a sub-class, which seems overkill to me,
> I decided to try a Category instead.
Categories don't override, they replace. As has already been noted , this means every NSMatrix instance in your app now uses your drawRect:. But it also means you can't have two instances of NSMatrix that had different drawing and you can no longer access the original implementation.
--
David Duncan
_______________________________________________
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