• 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: How to deal with a MenuItem with both a binded state property and an action method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to deal with a MenuItem with both a binded state property and an action method
      • From: "Joan Lluch (casa)" <email@hidden>
References: 
 >Re: How to deal with a MenuItem with both a binded state property and an action method (From: Keary Suska <email@hidden>)
 >Re: How to deal with a MenuItem with both a binded state property and an action method (From: "Joan Lluch (casa)" <email@hidden>)

  • Prev by Date: Re: Checking availability of host/website
  • Next by Date: Re: Why aren't my bindings firing?
  • Previous by thread: Re: How to deal with a MenuItem with both a binded state property and an action method
  • Next by thread: Re: How to deal with a MenuItem with both a binded state property and an action method
  • Index(es):
    • Date
    • Thread