• 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
Popup button crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Popup button crash


  • Subject: Popup button crash
  • From: Rosyna <email@hidden>
  • Date: Mon, 25 Feb 2002 21:24:27 -0700

I'm trying to build a popup button's menu based on context as soon as the menu is requested. I do this by adding an observer for my Popup button's cell in awakeFromNib like so:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popup:) name:NSPopUpButtonCellWillPopUpNotification object:[view cell]];

then the selector:

- (void)popup:(NSNotification *)notification
{
NSMenu* theMun=[[NSApp mainMenu] copyWithZone: NSDefaultMallocZone()];
NSLog(NSStringFromClass([[notification object] class])); //NSPopUpButtonCell
[[notification object] setMenu:theMun];
}

as soon as popup finishes, the application crashes with a SIGABRT error.

Is it even possible to do what I am trying to do?
--



Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insane People
---

Please include any previous correspondence in replies, it helps me remember what you're talking about. Thanks. _______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: Popup button crash
      • From: Carlos Weber <email@hidden>
References: 
 >Re: text-to-speech problems, or is it just me? (From: Isaac Sherman <email@hidden>)

  • Prev by Date: Nevermind..
  • Next by Date: Re: Carbon Date to NSDate - Here's How
  • Previous by thread: Re: text-to-speech problems, or is it just me?
  • Next by thread: Re: Popup button crash
  • Index(es):
    • Date
    • Thread