Re: Getting a reference to an NSMenuItem from another nib?
Re: Getting a reference to an NSMenuItem from another nib?
- Subject: Re: Getting a reference to an NSMenuItem from another nib?
- From: Sherm Pendley <email@hidden>
- Date: Tue, 14 Jun 2005 12:47:25 -0400
On Jun 14, 2005, at 12:13 PM, Theodore H. Smith wrote:
Yeah. It is best that the menu enabling code moves through the
relevant responders. I think then that the way that Cocoa is
designed is what I'll have to go with. I personally might have
designed Cocoa in such a way that if-tables were unnecessary for
menus...
If-tables are only necessary if you're comparing strings. If you're
comparing integers - such as tags, for instance - you'd use a switch:
-(BOOL) validateMenuItem:(NSMenuItem*)anItem {
switch([anItem tag]) {
case 0:
/* ... */
case 1:
/* ... */
default:
return YES;
}
}
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
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