FROM : Daniel Jalkut
DATE : Wed Jul 26 18:18:55 2006
On Jul 25, 2006, at 9:32 PM, Mark Dawson wrote:
> I seem to have lost the ability to open a document at launch--I
> have to click on the app a 2nd time for my main document to come
> up. I added the "applicationShouldOpenUntitledFile:" method to my
> app controller, and it only gets call once I double click a 2nd
> time on my app. I had been switching around my window controller
> nib, so I broke something. However, I'm not sure where to look.
> It just doesn't appear that an initial "open doc" command is being
> sent. Everything works for the "reopen" case?
>
> Thanks for any hints?
Let's review what we know:
1. Most document-based apps get applicationShouldOpenUntitledFile
called at launch.
2. You don't.
My instinct would be to examine a working case and guess how yours
differs. This is the stack crawl from a perfectly functional
document-based app. Do you see anything that you might be
inadvertently overriding in, say, an NSApplication subclass?
#0 -[FlextimeDelegate applicationShouldOpenUntitledFile:]
#1 0x936f4174 in -[NSApplication _doOpenUntitled] ()
#2 0x936f09a4 in -[NSApplication(NSAppleEventHandling)
_handleAEOpen:] ()
#3 0x936f0574 in -[NSApplication(NSAppleEventHandling)
_handleCoreEvent:withReplyEvent:] ()
#4 0x92944ae4 in -[NSAppleEventManager
dispatchRawAppleEvent:withRawReply:handlerRefCon:] ()
#5 0x92944944 in _NSAppleEventManagerGenericHandler ()
I might resort to setting breakpoints on things like "-[NSApplication
_doOpenUntitled]" or _handleAEOpen: to see if they get reached. If
they do then it's fairly easy to debug objective-C code from gdb even
without symbols, and you'll be able to figure out why it's deciding
not to call you.
Daniel
DATE : Wed Jul 26 18:18:55 2006
On Jul 25, 2006, at 9:32 PM, Mark Dawson wrote:
> I seem to have lost the ability to open a document at launch--I
> have to click on the app a 2nd time for my main document to come
> up. I added the "applicationShouldOpenUntitledFile:" method to my
> app controller, and it only gets call once I double click a 2nd
> time on my app. I had been switching around my window controller
> nib, so I broke something. However, I'm not sure where to look.
> It just doesn't appear that an initial "open doc" command is being
> sent. Everything works for the "reopen" case?
>
> Thanks for any hints?
Let's review what we know:
1. Most document-based apps get applicationShouldOpenUntitledFile
called at launch.
2. You don't.
My instinct would be to examine a working case and guess how yours
differs. This is the stack crawl from a perfectly functional
document-based app. Do you see anything that you might be
inadvertently overriding in, say, an NSApplication subclass?
#0 -[FlextimeDelegate applicationShouldOpenUntitledFile:]
#1 0x936f4174 in -[NSApplication _doOpenUntitled] ()
#2 0x936f09a4 in -[NSApplication(NSAppleEventHandling)
_handleAEOpen:] ()
#3 0x936f0574 in -[NSApplication(NSAppleEventHandling)
_handleCoreEvent:withReplyEvent:] ()
#4 0x92944ae4 in -[NSAppleEventManager
dispatchRawAppleEvent:withRawReply:handlerRefCon:] ()
#5 0x92944944 in _NSAppleEventManagerGenericHandler ()
I might resort to setting breakpoints on things like "-[NSApplication
_doOpenUntitled]" or _handleAEOpen: to see if they get reached. If
they do then it's fairly easy to debug objective-C code from gdb even
without symbols, and you'll be able to figure out why it's deciding
not to call you.
Daniel
| Related mails | Author | Date |
|---|---|---|
| Mark Dawson | Jul 26, 03:32 | |
| Daniel Jalkut | Jul 26, 18:18 | |
| Daniel Jalkut | Jul 26, 18:23 | |
| Mark Dawson | Jul 26, 19:36 | |
| Mark Dawson | Jul 26, 19:53 | |
| Mark Dawson | Jul 26, 20:45 | |
| Mark Dawson | Jul 26, 23:45 |






Cocoa mail archive

