• 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
Menu question 101 :-)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Menu question 101 :-)


  • Subject: Menu question 101 :-)
  • From: Maxwell Robertson <email@hidden>
  • Date: Tue, 16 Aug 2005 22:40:34 +0100

Hi All,
i am still getting my head around objective-c et al and I have run into a problem which maybe someone can explain it to me.


I have a Menus.m file which programmatically creates and populates multiple menus - these menus reflect user data so they have to be made at run time. Each menu item is assigned a target and action:

setTarget:self
setAction:@selector(doMenu:)

et all.

doMenu is defined as (IBaction)doMenu:(id)sender

All the menu code is called from one function called "launchedMenu" which when called at init time all works correctly. Menus load up and the code all works.

However I would like to call this function from another unrelated .m file.

This I can do and all the menus are built correctly. But the program crashes when any of the menu items are selected.

It seems to crash when the code gets to "doMenu:" - which I am guessing is now being associated with the wrong "self".

As stated earlier I am on the long objective-c learning path, so any pointers in this area would be appreciated. Even if it is which part of the documentation I should be reading. :-)
Max.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Menu question 101 :-)
      • From: Cameron Hayne <email@hidden>
  • Prev by Date: Re: SOAP and WebServices
  • Next by Date: Re: Are NSWindowDidResizeNotifications permitted to arrive on the heartbeat thread?
  • Previous by thread: Re: iSight barcode scanner
  • Next by thread: Re: Menu question 101 :-)
  • Index(es):
    • Date
    • Thread