Re: NSMenuItem protocol and incompatible types.
Re: NSMenuItem protocol and incompatible types.
- Subject: Re: NSMenuItem protocol and incompatible types.
- From: Jakob Olesen <email@hidden>
- Date: Tue, 1 Aug 2006 09:35:02 +0200
On 31/07/2006, at 13.58, Fredrik Olsson wrote:
Even typecasting as;
NSMenuItem *foo = (id <NSMenuItem>)[barMenu itemAtIndex:baz];
Gives the same warning. Requiring the typecast when depreciating
the protocol seems strange to begin with. What am I missing here?
[NSMenu itemAtIndex:] is declared as
- (id <NSMenuItem>)itemAtIndex:(int)index;
in both the 10.3.9 and 10.4u SDKs, so your cast is completely
redundant. Did you mean to write:
NSMenuItem *foo = (NSMenuItem*)[barMenu itemAtIndex:baz];
?
Anyway, like Matt, I get no warnings without the cast.
Are you subclassing NSMenu and changing the return type? That' s a no
no.
_______________________________________________
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