• 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: Comparing two NSMenus
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Comparing two NSMenus


  • Subject: Re: Comparing two NSMenus
  • From: j o a r <email@hidden>
  • Date: Sun, 7 Mar 2004 10:58:20 +0100

On 2004-03-07, at 09.30, Rosyna wrote:

> How can I compare two NSMenus for equality?

I think that you have to iterate and compare manually.

> If there is no AppKit built-in way, what happens if two things in an
> application (like a framework and a plugin) declare the same methods
> for a class in a category?

I'm no expert, but I think that the last loaded method for a given
selector will replace any existing method with the same selector. I
wouldn't try to design something that depended on the order that
classes and categories were loaded, as I think it would be difficult to
predict. For example I think that Zero Link will affect the loading
order.

The documentation states:

===============================================================
However, it cannot reliably override methods declared in another
category of the same class. A category is not a substitute for a
subclass. Its best if categories dont attempt to redefine methods
that are explicitly declared in the classs @interface section. Also
note that a class cant define the same method more than once.
When a category overrides an inherited method, the new version can, as
usual, incorporate the inherited version through a message to super.
But theres no way for a category method to incorporate a method with
the same name defined for the same class.
===============================================================

j o a r

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Comparing two NSMenus (From: Rosyna <email@hidden>)

  • Prev by Date: Comparing two NSMenus
  • Next by Date: Re: Addressbook style textfield
  • Previous by thread: Comparing two NSMenus
  • Next by thread: Re: How to load a nib from a path
  • Index(es):
    • Date
    • Thread