I found something really odd just now. The searchmenu is actually connected to an IBAction method. The NSLog sits in there and simply prints out the sender, i.e. the menuItem that triggered it.

If I change the menu item in the UI the NSLog printout shows that it's another part of memory that triggered it as if I trigger the searchaction through my code, so the objects are not identical. It's not that I instantiate more than one menu, so it's not clear to me where the other menu-twin with the same menuItems comes from. When I try to retrieve the menu through the NSSearchFields cell-menu, it's empty. This makes me wonder where the menu is actually stored and how many instances for whatever purposes are kept alive under the hood. I definitely only know of one NSMenu instance referenced through one IBOutlet which should be the one attached to the NSSearchField, but somehow I end up with two at runtime.

Any pointers would be of much help.

Thanks

On 03.11.2008, at 08:31, Alexander Reichstadt wrote:

Hi,

when trrying to change the tickmark next to a menu of an NSSearchField it works exactly once, after that it doesn't work any more. I have to relaunch the app. I see that my code is indeed executed, but it makes no difference after the first time. Or maybe it's not refreshed somehow.

        [[[mySearchMenu itemArray] objectAtIndex:1] setState:NSOnState];
        [[[mySearchMenu itemArray] objectAtIndex:0] setState:NSOffState];


Is there some fault with my code?

Thanks
Alexander

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to