iOS Development outreach-jump and data transfer between apps

Source: Internet
Author: User

iOS Development outreach-jump and data transfer between apps

Description: This article describes how the app can open another app and pass data.

A simple explanation

Create a new two apps for app A and app B, respectively.

Implementation requirements: Click the corresponding button on the Appa page to open the APPB application.

1. Create a new two apps, A and B, respectively.

2. Set the URL of app B.

3. Write code to open the app in app a

Once clicked, it jumps to the new controller.

Note: B has two states in the process of opening app B.

The first state: B does not start, then B is started. and call the following method.

Second state: At this point, B is started, but it is running in the background, this time it is not called.

II: Description

If an application is opened by another application, the following proxy method is invoked, and the data transfer between the two applications can be implemented in this method.

Code Description:

1 #import "YYAppDelegate.h" 2  3 @implementation yyappdelegate 4  5-(BOOL) Application: (UIApplication *) Application didfinishlaunchingwithoptions: (Nsdictionary *) launchoptions 6 {7     NSLog (@ " Didfinishlaunchingwithoptions---B "); 8     return YES; 9}10 11//When an application is opened by another program, this method is called, in which the data between two applications can be implemented by the Bureau (BOOL) application: (UIApplication *) Application OpenURL: (nsurl *) URL sourceapplication: (NSString *) sourceapplication annotation: (id) annotation13 {14     NSLog (@ "%@", url);     NSLog (@ "%@", sourceapplication);     return yes;17}

iOS Development outreach-jump and data transfer between apps

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.