• 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: setAction:@selector is not working ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setAction:@selector is not working ?


  • Subject: Re: setAction:@selector is not working ?
  • From: "David M. Cotter" <email@hidden>
  • Date: Fri, 19 Feb 2010 12:12:29 -0800

good tip, but no luck.  same problem.  myFunction is never called when i pick an item :(

On Feb 19, 2010, at 11:50 AM, Michael Vannorsdel wrote:

> I would try and reset the target just after setting the action:
>
> [myMenuItem setAction:@selector(myFunction:)];
> [myMenuItem setTarget:self];
>
> I remember a long time ago I had a problem where if I reset the item's action, it would set the target to nil for some reason.  So in practice I usually reset the target even if it's the same.
>
> Not sure if this is your issue though.
>
>
> On Feb 19, 2010, at 12:43 PM, David M. Cotter wrote:
>
>> just before the line of code that pops up the menu, i iterate over all the items
>> so yes, i am absolutely sure it is getting called
>> and i am absolutely sure that myMenuItem is non null
>>
>> i'm just wondering if there is something which pre-empts my code, telling the menu item to NOT call the action selector.  what could *possibly* intervene here?

_______________________________________________

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: 
 >setAction:@selector is not working ? (From: "David M. Cotter" <email@hidden>)
 >Re: setAction:@selector is not working ? (From: Graham Cox <email@hidden>)
 >Re: setAction:@selector is not working ? (From: "David M. Cotter" <email@hidden>)
 >Re: setAction:@selector is not working ? (From: Jens Alfke <email@hidden>)
 >Re: setAction:@selector is not working ? (From: "David M. Cotter" <email@hidden>)
 >Re: setAction:@selector is not working ? (From: Michael Vannorsdel <email@hidden>)

  • Prev by Date: Re: setAction:@selector is not working ?
  • Next by Date: Re: Appropriate -setWantsLayer: timing
  • Previous by thread: Re: setAction:@selector is not working ?
  • Next by thread: Re: setAction:@selector is not working ?
  • Index(es):
    • Date
    • Thread