开发者

Help me to run a iPhone application

I am going to develop a iPhone application.

In that i need to run another iPhone app when the user clicks on the button.

Is it possible to run a iPhone app 开发者_Python百科from another iPhone app?

If possible, Please let me know your inputs on this.

Thanks for any help.


[copy and paste of a previous answer I gave here for the click-averse]

You can use the url scheme built into iOS. For example, you could call Safari with a url because it is registered as the application which handles the http URL scheme

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.google.com/"]]

The openURL: method is an instance method of the singleton UIApplication instance, on which you can call any application installed which registers in its plist an ability to handle some sort of input data.

Here's a list of common url schemes in iOS.

A little known way to detect the existence of another application on a device is to use canOpenURL: on the same singleton instance:

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"cydia://"]])
{
    NSLog(@"cydia installed");
}
else
{
    NSLog(@"cydia not installed");
}


Only if that other app is already installed and run and has been designed to register a custom URL handler to itself with the OS.

The your app can run it by using that custom URL scheme.


If the app has a custom URL Schema and you know what it is, then it is possible to launch another app form yours.


When user pressed the button, your current app will close and run the new app..

Yea.. Its possible.. BUT you must know the "short link" of the other app.. I tried it before and even successfully transferred data from the lite version to the full version..

Its called url scheme..

Here's a link: http://www.idev101.com/code/Objective-C/custom_url_schemes.html

Hope it can achieve what you want..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜