• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cannot change menu state in NSSearchField menu for more than once
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cannot change menu state in NSSearchField menu for more than once


  • Subject: Re: Cannot change menu state in NSSearchField menu for more than once
  • From: Alexander Reichstadt <email@hidden>
  • Date: Mon, 03 Nov 2008 08:58:20 +0100

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 (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

References: 
 >Cannot change menu state in NSSearchField menu for more than once (From: Alexander Reichstadt <email@hidden>)

  • Prev by Date: Re: Porting SetupComm function in Mac
  • Next by Date: Re: Porting SetupComm function in Mac
  • Previous by thread: Cannot change menu state in NSSearchField menu for more than once
  • Next by thread: Re: Cannot change menu state in NSSearchField menu for more than once
  • Index(es):
    • Date
    • Thread