• 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: "Stephen J. Butler" <email@hidden>
  • Date: Fri, 30 Mar 2012 22:46:00 -0500

On Fri, Mar 30, 2012 at 10:31 PM, Peter Teeson <email@hidden> wrote:
> Rather than using a sub-class, which seems overkill to me,
> I decided to try a Category instead. So here's what I did (and it seems to work.)

The problem with this approach is that you've replaced the drawRect:
for every NSMatrix instance, everywhere, in your app. If some Cocoa
control is using NSMatrix, suddenly it's using your drawRect:. If you
decide to use NSMatrix somewhere else, it too is using this drawRect:.

I wouldn't trust this to be very stable. And I don't see how
subclassing is much more work than this.
_______________________________________________

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

References: 
 >drawRect using a Category (From: Peter Teeson <email@hidden>)

  • Prev by Date: drawRect using a Category
  • Next by Date: Problem with NSScrollView and scroll bars
  • Previous by thread: drawRect using a Category
  • Next by thread: Re: drawRect using a Category
  • Index(es):
    • Date
    • Thread