how to connect or open another aplication with xcode?
now.. I was making a program.. but I want to make the program connected to another application or make an application running in my application.. such开发者_如何学C as, when people want to sign up to my application, I want to open safari application or make it running in my application? how can I do so? is there anyone help me with a sample code?
Or for example, in yelp, clicking some button will open google map application and point direction from our location to the next
how would I do so?
Depends on your platform. For OSX, NSAppleScript
is your solution. It allows you to interact with other scriptable programs like Safari, iTunes, Finder, etc.
For iPhone, your question has been asked / answered before: Open Google Maps from iPhone and show route
If what you want is a generic way to launch any app on iOS, there is no way to do it (at least using the official APIs).
It is possible, however, to launch a few apps based on their supported URL schemes.
To do this, you would do something like:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
This will allow you to open a few native apps like Safari, Mail, Maps, Messages, App Store, etc (and depending on the URL, it may not only open the app but also perform some app-specific action).
There are a few repositories that list both native and third-party apps and their known URL schemes, such as these:
- http://handleopenurl.com/scheme
- http://wiki.akosma.com/IPhone_URL_Schemes
精彩评论