• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: drawRect using a Category
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: drawRect using a Category
      • From: Peter Teeson <email@hidden>
References: 
 >drawRect using a Category (From: Peter Teeson <email@hidden>)

  • Prev by Date: drawing lines in and NSTextView
  • Next by Date: Re: Best Way to Append Bytes With Encoding To CFMutableString
  • Previous by thread: Re: drawRect using a Category
  • Next by thread: Re: drawRect using a Category
  • Index(es):
    • Date
    • Thread