NSDocument-based app
What would be the best way to implement HockeySDK in an NSDocument-based Mac app? I've left the -showMainApplicationWindow method empty for now since my app delegate doesn't have a main window (windows are loaded by an NSWindowController subclass). Is that the recommended way to work?
Steven
Support Staff 2 Posted by Andreas Linde on 23 Jul, 2012 03:26 PM
Hello Steven,
sorry for the late response. I needed to get some expert info on that, since I've never dealt with NSDocument based apps myself so far.
The advice is as follows:
- Do what you did :) - Setup the SDK at the end of applicationDidFInishLaunching, since otherwise you may loose the Apple events to restore, open untitled document etc.
This way you will not be able to catch crashes coming up earlier, but the SDK won't make anything worse in that scenario. We have some ideas on how to make this better, but that needs some time for implementation and testing and we are currently busy with some other tasks. But the way described should work so far.
Best,
Andreas
3 Posted by Thomas on 09 Aug, 2012 12:06 AM
How would I open an untitled window on startup if needed?
I tried:
but this also opens an untitled window when restoration happens. What is the recommended way to do this? It seems like
applicationShouldOpenUntitledFileis not being called.Support Staff 4 Posted by Andreas Linde on 09 Aug, 2012 09:52 AM
Hi Thomas,
just don't do anything in that method and show your UI as always. Also make sure to initialize the SDK at the end of applicationDidFinishLaunching as mentioned in my previous post.
Best,
Andreas
5 Posted by Thomas on 12 Aug, 2012 04:16 AM
Hi Andreas,
If I leave
showMainApplicationWindowempty and initialize the framework inapplicationDidFinishLaunchingas you are suggesting, and I open the app, close all windows, quit the app and then relaunch the app then I don't get any windows when I reopen the app. I suppose this may be related to window restoration. What I want is to have one untitled window in this scenario.Please let me know if you've ran into this issue and how I could fix it.
Thomas
Support Staff 6 Posted by Andreas Linde on 13 Aug, 2012 09:23 PM
Hi Thomas,
my experience with document based Mac apps is sadly very very limited, so I don't know how to fix this.
We have another approach on our todo list for the Mac SDK to show the crash report dialog when the crash report occurs and not on the next startup. But we need quite some time to implement and test it, since that is quite tricky to do, especially in the sandbox. And we are not sure yet if we can make it work. But that would solve your problem and some others too.
Sorry I don't have a better answer for you,
Andreas