views:

133

answers:

2

Is it possible to run an iPhone app from your own app? For example when you press a button in your app, the iPhone switches to another app. If so, how would you do this?

+2  A: 

Yes, but the developer of the app being switched to will have to have specified a URL protocol handler. For more information on those, look here. If it has specified a protocol handler, you can use the openURL: method to open the URL. Example (opens the Phone app and dials a number:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://123456789"]];

The easiest way to make sure this works is if you're the developer of the app being launched.

igul222
+2  A: 

"You can register URL types for your application that include custom URL schemes. A custom URL scheme is a mechanism through which third-party applications can interact with each other and with the system. Through a custom URL scheme, an application can make its services available to other applications."

Implementing Custom URL Schemes

Take a look at "Registering Custom URL Schemes" and "Handling URL Requests"

Adolfo