• 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
Running event loop while showing non-standard popup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Running event loop while showing non-standard popup


  • Subject: Running event loop while showing non-standard popup
  • From: Steve Mills <email@hidden>
  • Date: Mon, 20 May 2013 12:00:30 -0500

None of this code was written by me, so I don't know the reasoning behind the design. We have a popup that shows an NSWindow with an NSBrowser in it. There is a NSPopUpButtonCell subclass that handles the click with trackMouse:inRect:ofView:untilMouseUp:. This trackMouse method calls [NSApp run].

When a click happens outside the browser window, it calls [NSApp stop:nil] from our NSWindowDidResignKeyNotification observer for the browser window. At that point, it seems like the app is actually trying to terminate, because all hell breaks loose - release builds crash with no crash log and debug builds crash with a stack of:

#0-9 is in the dtor for one of our global objects.
#10	0x91a1cebf in __cxa_finalize ()
#11	0x91a1fdb9 in exit ()
#12	0x957ba692 in NSApplicationMain ()
#13	0x01310fb8 in main ()

This leads me to believe that using run and stop: is the wrong way to do this. What's another way to start and stop a "local" run loop?

--
Steve Mills
office: 952-818-3871
home: 952-401-6255
cell: 612-803-6157



_______________________________________________

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: Running event loop while showing non-standard popup
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Widow / Orphan protection in text layout
  • Next by Date: Re: Running event loop while showing non-standard popup
  • Previous by thread: Re: Widow / Orphan protection in text layout
  • Next by thread: Re: Running event loop while showing non-standard popup
  • Index(es):
    • Date
    • Thread