参考:
[1]http://wiki.akosma.com/IPhone_URL_Schemes
[2]http://www.idev101.com/code/Objective-C/custom_url_schemes.html
在iphoneapp中使用如下代码,即可在app中跳转到safari并打开网址,其实每个app都可以定义一个独的url,实现从其他app跳转。比如系统电话的url 即为:tel:// ,其他系统常用的app URL 见参考[1]。
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://baidu.com"]];
那要在app中添加该app的url只要在info.plist设置如下即可:

设置的url sechmes为testUrl ,另外需要在app delegate处理是否允许通过url启动该app,返回YES即可。代码如下
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
// handler code here
}
只要在safari中输入testUrl://other 即可跳转到该app。
1万+

被折叠的 条评论
为什么被折叠?



