网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

App之间的跳转

App之间的跳转

成都创新互联专注于新宾企业网站建设,响应式网站建设,商城网站制作。新宾网站建设公司,为新宾等地区提供建站服务。全流程定制设计,专业设计,全程项目跟踪,成都创新互联专业和态度为您提供的服务

1,添加URL Types项

a,打开项目中.xcodeproj下的info目录,增加一项URL Typs
 App之间的跳转

2,配置URL Scheme

a,将URL identifie选项为com.KeYi.lsf

b,将URL Scheme选项的内容修改为lsf


 - (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation
{
//抓取url
    if (!url) {
        return NO;
    }else {
        if ([[url host] isEqualToString:@"expert"]) {
            
            NSArray *codeArr = [[url query] componentsSeparatedByString:@"="];
            if (codeArr.count >0) {
                if (self.window.rootViewController) {
                    BaseTabBarController *tabBarController = (BaseTabBarController*)self.window.rootViewController;
                    BaseNavigationController * bnc = (BaseNavigationController*)tabBarController.selectedViewController;
                    HomeDetailController * hdc = [[HomeDetailController alloc]init];
                    hdc.expertInfoDic = @{@"expertUserId":codeArr[1]};
                    [bnc pushViewController:hdc animated:YES];
                }else {
                    
                }
            }
            return YES;
        }else if ([[url host] isEqualToString:@"topic"]) {
            NSArray *codeArray = [[url query] componentsSeparatedByString:@"&"];
            NSArray *codeArr = [codeArray[0] componentsSeparatedByString:@"="];
            NSArray *otherArr  = [codeArray[1] componentsSeparatedByString:@"="];
            if (codeArr.count > 0) {
                if (self.window.rootViewController) {
                    BaseTabBarController *tabBarController = (BaseTabBarController*)self.window.rootViewController;
                    BaseNavigationController * bnc = (BaseNavigationController*)tabBarController.selectedViewController;
                    ExpertDetailController * edc = [[ExpertDetailController alloc]init];
                    edc.topicInfo = @{@"topicId":codeArr[1],@"expertUserId":otherArr[1]};
                    [bnc pushViewController:edc animated:YES];
                }else {
                    
                }

            }
            return YES;
        }
            
    }
...
}


文章题目:App之间的跳转
转载源于:http://bjjierui.cn/article/jdjspp.html

其他资讯