Re: Cocoa class extension best practice
Re: Cocoa class extension best practice
- Subject: Re: Cocoa class extension best practice
- From: Dave <email@hidden>
- Date: Wed, 16 Oct 2013 20:04:05 +0100
Hi,
Out of interest, have you tried doing this:
- (NSMenuItem*)itemWithTag:(NSInteger)tag searchSubmenus:(BOOL)searchSubmenus depthFirst:(BOOL)depthFirst
{
NSMenuItem* item; //*****
NSArray* myArray; //*****
NSMenuItem* subitem; //*****
if(!depthFirst) {
id item = [self itemWithTag:tag];
if(item)
return item;
}
if(searchSubmenus)
{
myArray = [self itemArray]; //******
for( item in myArray])
{
if([item hasSubmenu])
{
subitem = [[item submenu] itemWithTag:tag searchSubmenus:searchSubmenus depthFirst:depthFirst];
if(subitem)
return subitem;
}
}
}
return [self itemWithTag:tag];
}
I doubt it will make any difference, but I've had problems with definining variable in the for/in statement before.
Cheers
Dave
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden