I'm developing an app for the iPhone, but I guess the question is the same on the Mac. What is your approach to debug the state of your application after it has been launched by its URL scheme?
views:
319answers:
2
+2
A:
Actually, I think it would be quite different on the Mac than on the iPhone as you can have the application open already on the Mac and call the URL scheme, whereas on the iPhone you need to quit the application to open another to call the URL scheme.
What you could try is adding a debug button to your UI which allows you to call the URL scheme from inside the running application (calling -openURL: on NSWorkspace). This should in theory work the same whether your app is open or closed when the URL scheme is sent.
Martin Pilkington
2009-01-17 23:30:44
thanks, i also think thats the way to go then..
stigi
2009-01-18 18:24:12
+1
A:
There is a way to debug your application when it is launched from an external URL:
- Set a breakpoint where you want it in
application:handleOpenURL:
orapplication:didFinishLaunchingWithOptions:
- In Xcode, edit the Active Executable's settings. On the Debugging tab, select the "Wait for next launch/push notification" checkbox.
- Build and Debug. The Console will give you an alert saying "Waiting for [AppName] to launch... The debugger will attach to [AppName] the next time it is launched."
- Open your app by invoking a custom URL or sending it a push notification. The debugger will stop at your breakpoint.
Ole Begemann
2010-04-24 12:00:25
Thanks, found the answer myself some month ago, but forgot to post it here. Answer, check!
stigi
2010-04-26 10:16:32