Re: Category conflicts with Tiger
Re: Category conflicts with Tiger
- Subject: Re: Category conflicts with Tiger
- From: Justin Spahr-Summers <email@hidden>
- Date: Sat, 7 May 2005 15:20:28 -0500
Can't categories override methods?
On 5/7/05, David Sinclair <email@hidden> wrote:
> I have a large collection of categories that I use for all my apps,
> extending the Cocoa classes. (I plan on releasing them publicly when I
> get time.)
>
> Reading through the release notes for Tiger, I've noticed several new
> methods that conflict with my categories. For example, I have a
> NSPopUpButton category that adds the following method, which conflicts
> with a new Tiger method:
>
> - (int)selectItemWithTag:(int)aTag;
>
> This one isn't too difficult to resolve (I just need to rename it to
> avoid the conflict, with corresponding changes to existing code), but
> there are others that are harder to resolve.
>
> One such is a NSImageView category that implements -cut:, -copy:,
> -paste:, and -delete:. I see that NSImageView now implements those
> natively. I can't simply rename my editions, since then they wouldn't
> be used, and can't remove them, as then those functions wouldn't work
> when running under Panther. What is the best way to resolve this
> conflict? Would calling -setAllowsCutCopyPaste: with NO disable
> Cocoa's implementation but let mine continue, or would mine fail too
> (since it is a category rather than a subclass). Is implementing them
> in a subclass of NSImageView instead of a category the only feasible
> solution?
>
> --
>
> David Sinclair, Dejal Systems, LLC - email@hidden
> Custom Mac OS X development - http://www.dejal.com/consulting/
> Site change and failure monitor tool - http://www.dejal.com/simon/
> Plus other useful Mac products - http://www.dejal.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden