<span id="Label3"></p><p><p>We often encounter the need to exhale another application in one application, such as clicking on an address in a document, calling Safari to open a Web page, such as clicking a file in a file browser and automatically activating a file to be Opened.</p></p><p><p>iOS uses URLs for such requirements, and other applications as a resource, essentially invoking system Resources.</p></p><p><p>We have two applications App1 and App2, in App2 to call out App1, then first configure App1, let the system know APP1 url, This is the configuration of some of the Info.plist files, in Xcode is to configure some options, in the Xcode4.6.2 look like:</p></p><p><p></p></p><p><p>This sets up the related items, identifier need to keep each application different, so the recommended reverse domain name, URL schemes is the beginning of the URL to call the app.</p></p><p><p>In the APP1 settings to here, App2 inside need to call out App1, the code is very simple:</p></p><p><p></p></p><strong><strong>[objc]</strong></strong>View Plaincopy<object id="ZeroClipboardMovie_1" width="18" height="18" align="middle" bgcolor="#ffffff" data="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" type="application/x-shockwave-flash"><object id="zeroclipboardmovie_1" width="up" height="align=" "middle" bgcolor="#ffffff" data="/http static.blog.csdn.net/scripts/zeroclipboard/zeroclipboard.swf " type=" Application/x-shockwave-flash "><param name=" SRC " value=" http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf "> <param name="loop" value="loop"><param name="menu" value="false"><param name="quality" value="best"><param Name="allowscriptaccess" value="always"><param name="allowfullscreen" value="false"><param name="pluginspage" value=" Http://www.macromedia.com/go/getflashplayer "><param name=" flashvars " value=" id=1&width=18&height=18 ">< param name= "wmode" value= "transparent" > </object></object><object id="ZeroClipboardMovie_1" width="18" height="18" align="middle" bgcolor="#ffffff" data="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" type="application/x-shockwave-flash"><object id="zeroclipboardmovie_1" width="up" height="align=" "middle" bgcolor="#ffffff" data="/http static.blog.csdn.net/scripts/zeroclipboard/zeroclipboard.swf " type=" Application/x-shockwave-flash "><param name=" SRC " value=" http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf "> <param name="loop" value="loop"><param name="menu" value="false"><param name="quality" value="best"><param Name="allowscriptaccess" value="always"><param name="allowfullscreen" value="false"><param name="pluginspage" value=" Http://www.macromedia.com/go/getflashplayer "><param name=" flashvars " value=" id=1&width=18&height=18 ">< param name= "wmode" value= "transparent" > </object></object> <ol class="dp-objc" start="1"> <ol class="dp-objc" start="1"> <li class="alt"><span class="keyword">Nsurl *url = [nsurl<span class="vars"> urlwithstring:<span class="string">@ "myapp://"]; </span></span></span></li> <li></li> <li class="alt"><span class="keyword">If ([[[uiapplication<span class="vars"> sharedapplication]<span class="vars"> canopenurl:url]) {</span> </span></span></li> <li>NSLog (<span class="string">@ "can open%@", url); </span></li> <li class="alt">[[uiapplication<span class="vars"> sharedapplication]<span class="vars"> openurl:url]; </span></span></li> <li>}</li> </ol> </ol><strong><strong> </strong></strong><p><p>The URL must be myapp://up, followed by some content, if only to call out the application, then only write this header can Be.</p></p><p><p></p></p><p><p></p></p><p><p>here, we have achieved the APP2 within the App1. After the iOS4.2 system, such a call will be called in App1-(BOOL) application: (uiapplication *) application openURL: (nsurl *) URL Sourceapplication: (nsstring *) sourceapplication annotation: (id) annotation such a method.</p></p><p><p>How to call out another app in iOS</p></p></span>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service