Preparatory work
Two new applications, ProjectA and PROJECTB, respectively.
Then from a contribute data to B
Then set the URL of the PROJECTB schemes
To add a jump URL in projecta:
nsurl *url = [nsurl urlwithstring:@"Projectb:hehe"]; [[uiapplication sharedapplication] Openurl:url];
So the argument behind the Projectb:hehe colon is the data we can pass through.
App Status
- b does not start, then B is started. and call the following method.
-(BOOL) Application: (uiapplication *) application didfinishlaunchingwithoptions: ( NsdictionaryNSLog(@"Projectb_start"//Override point for customization after application Launch. return YES;}
- At this point B has started, but run in the background, this time will not invoke the method, and will go:
//When an application is opened by another program, this method is called, in which the data transfer between two applications can be implemented -(BOOL) Application: (uiapplication * ) Application OpenURL: (nsurl *) URL sourceapplication: (nsstring *) sourceapplication annotation: ( ID NSLog (@ "%@"NSLog(@"%@"returnYES;}
is not very simple, then you also hurry to try it!
Sharing data between iOS apps