I am working on a app which could be launched over a URL. I have already defined my url scheme using xcode on info page. I filled for identifier my Bundle identifier and for URL Schemes myapp.
Now if I try to open in safari myapp://foo, it launches my app and stops at my breakpoint in
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation
method.
Problem is annotation, url, application, sourceapplication parameters are nil. So I can not pass parameters...
After unnecessary time loss, I have found out, the problem was the debugger. It shows the url is nil and if I try to print description it says
Printing description of url:
<nil>
But If I try to NSLog it shows the url. And if put the following code in the method
if (! url) {
return NO;
}
The debugger shows also the url.
Are you sure your project is in debug mode!? See here http://nerdwa.com/index.php/2011/09/debugrelease-schemes-in-xcode-4/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.