Re: How to deal with a MenuItem with both a binded state property and an action method
Re: How to deal with a MenuItem with both a binded state property and an action method
- Subject: Re: How to deal with a MenuItem with both a binded state property and an action method
- From: Ken Thomases <email@hidden>
- Date: Sat, 28 Jun 2008 02:59:16 -0500
On Jun 28, 2008, at 2:41 AM, Joan Lluch (casa) wrote:
The problem remains because when the user selects the menuItem the
following happens:
FIRST- myAction is executed (possibly setting menuState to an
appropiate value)
SECOND - setMenuState is executed with a value contrary to the last
one, so if I had set it to NO in myAction, it is called now with
YES, destroying completely the intended behaviour. The menu item
then shows the wrong state in the running app.
From where is this second call to setMenuState: coming?
Put a breakpoint on it and backtrace. In Xcode's Breakpoints window
(Run > Show > Breakpoints), toggle open the breakpoint's disclosure
triangle. Click the plus button to add a debugger command. Enter
"bt" as the command. Enable the "Log" checkbox beneath the debugger
command field. Click the checkbox in the continue (▐▶) column, so
that the program automatically continues after the breakpoint fires.
With this setup, the debugger console will get a backtrace every time
your setMenuState: method is called, but it won't annoying break the
flow of your application or require you to hit continue each time.
Cheers,
Ken_______________________________________________
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