On Mar 3, 2009, at 12:30 PM, Mark D. Gerl wrote:

[statusItem setMenu:theMenu];

Why are you setting the menu twice? This step might be redundant.

[statusItem setEnabled:YES];

This line is redundant and can probably be taken out.

// build NSMenu by HAND
NSMenu *menu = [[[NSMenu alloc] initWithTitle:@"abc"] autorelease];
if (menu != NULL)

You don't have to worry about this. There are a few classes that may return nil (not NULL) if initialization fails, such as NSPipe. NSMenu is not one of these classes, and most likely never will be.

        [item autorelease];

Here you're autoreleasing an object you did not initialize or copy or retain, which will cause trouble if you're not using GC.

        // *** DOING this causes the menu to NOT pop down ***
        [menu setDeligate:menuController];

Is that a typo? That should be -setDelegate:. If it isn't, then that should be raising a compiler warning, in which case, do you have warnings turned off?

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to