App launched in Xcode can't gain key and order front
App launched in Xcode can't gain key and order front
- Subject: App launched in Xcode can't gain key and order front
- From: Ben Lachman <email@hidden>
- Date: Sun, 25 Mar 2007 01:37:43 -0400
A couple months ago I posted the attached message to the Xcode list
but never was able to figure the problem out. I am now thinking it
is more of a code level problem than a compiler problem though.
To sum things up, when launched within XCode my app often never gains
focus/order/foreground/selection. If I run it through the debugger,
I notice the app never posts the applicationDidFinishLaunching
notification. However if you pause the debugger the app is just
sitting there polling for events (of which it will never receive any
since the app does not have any keyboard/mouse input). A backtrace
is as follows:
#0 0x9000b4c8 in mach_msg_trap ()
#1 0x9000b41c in mach_msg ()
#2 0x907deba8 in __CFRunLoopRun ()
#3 0x907de4ac in CFRunLoopRunSpecific ()
#4 0x9329bb20 in RunCurrentEventLoopInMode ()
#5 0x9329b1b4 in ReceiveNextEventCommon ()
#6 0x9329b020 in BlockUntilNextEventMatchingListInMode ()
#7 0x937a1ae4 in _DPSNextEvent ()
#8 0x937a17a8 in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#9 0x9379dcec in -[NSApplication run] ()
#10 0x9388e87c in NSApplicationMain ()
#11 0x00002e7c in main (argc=3, argv=0xbffff9c0) at /Users/ben/
Desktop/BoxApp/Source/main.m:13
Now, the more I experience the problem, the more I think it is
something I'm doing. It seemingly always happens after my CoreData
store has been modified. I am using the basic CoreData skeleton with
a bunch of my own initialization done in the app delegate's init
method, some of which touches CoreData.
Things I can do that *always* make it run normally:
- Delete the CoreData store file in ~/Library/ApplicationSupport
- Launch the App from the finder (or by double clicking the "product"
in Xcode which does the same thing)
Things I can do that *sometimes* make it launch normally within Xcode
- change the arguments the application is launched with
(NSZombieEnabled is the one I often toggle)
- launch it in the debugger instead of just running it
I don't know exactly where to go next since there is nothing to debug
and no errors anywhere (checked system logs, crash reports, etc.),
and nothing is crashing.
Anyone have any ideas?
Thanks,
->Ben
On Jan 22, 2007, at 3:31 AM, Ben Lachman wrote:
Hi all. I have an app I just came back to after taking about a
month off programming for my first daughter's birth. However when
I launch the app from within Xcode, it no longer gains key or order
front no matter what you do. The app is seemingly hung, although
if you attach the debugger to it (or launch it in the debugger), it
looks as if you paused it while doing nothing except polling for
events. Nothing I've tried (sampling, spin control, switching
apps, clean and rebuild, update Xcode, reinstall Xcode, etc.) has
had any effect. I tried reverting to a revision that had worked
fine (as of 11/1) and it now hangs on launch as well. The most
frustrating thing is that every once in a while it will launch the
app just fine, but the next time I launch it it will hang. If I
launch it from the finder it runs normally.
Any ideas? This is driving me up the wall.
Thanks,
->Ben
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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