Re: NSMenuItem <protocol>
Re: NSMenuItem <protocol>
- Subject: Re: NSMenuItem <protocol>
- From: Marten van Gelderen <email@hidden>
- Date: Thu, 11 Mar 2004 08:35:36 +0100
j o a r,
I am very sorry for my misinterpretation. However, something did happen
some months ago, probably when switching from PB to Xcode with the new
GCC compiler.
About a year ago I implemented the obvious -(MSmenuItem
*)itemWithSubmenu:(NSMenu *)submenu, partly to experiment with
categories, partly because I thought it is a logical method to have in
a NSMenu class.
That used to work fine, but some months ago the compiler started to
warn me that I had a "return from incompatible pointer type". The
remedy was easy but, as said before, I sort of like the NSMenuItem *
better than the id <NSMenuItem>. I wrongly thought it was Apple who
changed the return types. Now I suppose it's the compiler who performs
different (better?) type checking?
On 10 Mar 2004, at 5:57 PM, j o a r wrote:
I think you're mistaken. These methods have returned protocol typed
id's for a long, long, time - even before Mac OS X was released as a
matter of fact!
j o a r
On 2004-03-10, at 17.26, Marten van Gelderen wrote:
As of XCode 1.1 the following 3 methods in NSMenu:
- (id <NSMenuItem>)itemAtIndex:(int)index;
- (id <NSMenuItem>)itemWithTitle:(NSString *)aTitle;
- (id <NSMenuItem>)itemWithTag:(int)tag;
--
Groeten, Marten
_______________________________________________
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.