iphone程序间互相调用

 

新建一个project B

1.配置info.plist文件,打开info.plistt通常在resource folder下

2.选择 Information Property Lis,然后点击

3.滚动到最下面选择"URL types" 

4.URL types->Item 0->URL identifier,为URL identifiers输入标识如com.my.appb

5.在URL identifierb被选中的情况下,点击右边的按钮然后选择URL Schemes

至此主要工作已完成,info.plist如下

iphone程序间互相调用_第1张图片

在project A 中


- (void)launchMe

{

[[UIApplicationsharedApplication] openURL:[NSURLURLWithString:@"appb://"]];

}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

    

   // Override point for customization after application launch.

[selfperformSelector:@selector(launchMe)withObject:nilafterDelay:0.0];

   // Add the view controller's view to the window and display.

    [self.windowaddSubview:viewController.view];

    [self.windowmakeKeyAndVisible];

   return YES;

}

当启动A时候,会调用B。

你可能感兴趣的:(工作,application,url,iPhone,Types)