Newbie NSPopUpButton addItemWithTitle: problem from a menu
Newbie NSPopUpButton addItemWithTitle: problem from a menu
- Subject: Newbie NSPopUpButton addItemWithTitle: problem from a menu
- From: "Hunt Sparra" <email@hidden>
- Date: Fri, 24 May 2002 23:11:14 -0400
I have created a document based application with a
NSPopUpButton. I load the button values by using [popUpButon
addItemWithTitle:@some title]. This works fine when called from
the windowDidLoadNib and when using a button in the
MyDocument.Nib. I cannot seem to get it to work when call the
method from the MainMenu.Nib. I dragged my MyDocument.h to
the Nib, instantiated MyDocument.h, and then wired up a menu
item with the action in MyDocument.
A NSLog shows that [myPopUp titles] has values when used from
windowDidLoadNib and when called from the button in
MyDocument.Nib. When called from MainMenu.nib, NSLog shows
[myPopUp titles] is (null). I figure I missing something simple, but
have not been able to figure it out. The calls from
windowDidLoadNib and the button in MyDocument.Nib were
added after trying to get it to work from the menu. I have looked
and NSPopUpButton, NSPopUpButtonCell, NSButton, NSCell,
NSMenu, NSMenuItem, and the button discussion. I do realize that
I may be missing something basic in this documentation.
Any help would be greatly appreciated.
_______________________________________________
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.