• 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: Overriding Methods via Category Now A no-no?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Overriding Methods via Category Now A no-no?


  • Subject: Re: Overriding Methods via Category Now A no-no?
  • From: glenn andreas <email@hidden>
  • Date: Mon, 26 Mar 2012 17:56:33 -0500

If it were perfectly fine for your category to override a method, it would be perfectly fine for a second category to also override that method.

Now you've got two categories overriding the same method and the order of which category gets loaded (and "wins") is undefined.

There are other potential problems as well, such as that method being called before your code is loaded, resulting in inconsistent behavior (depending on where you category lives).


On Mar 26, 2012, at 5:40 PM, Keary Suska wrote:

> Clang now complains with, "Category is implementing a method which will also be implemented by its primary class", but I understood that overriding methods via category was perfectly fine although with some drawbacks. Is there really a cogent reason that this is now a warning, and that I should heed it?
>
> TIA,
>
> Keary Suska
> Esoteritech, Inc.
> "Demystifying technology for your home or business"
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

Glenn Andreas                      email@hidden
The most merciful thing in the world ... is the inability of the human mind to correlate all its contents - HPL

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Overriding Methods via Category Now A no-no? (From: Keary Suska <email@hidden>)

  • Prev by Date: Overriding Methods via Category Now A no-no?
  • Next by Date: XCode 4 & copied frameworks
  • Previous by thread: Overriding Methods via Category Now A no-no?
  • Next by thread: Re: Overriding Methods via Category Now A no-no?
  • Index(es):
    • Date
    • Thread