App之间的跳转-创新互联

App之间的跳转

创新互联是专业的汝城网站建设公司,汝城接单;提供成都网站设计、做网站、成都外贸网站建设公司,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行汝城网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

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;
       }

   }
...
}

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


本文名称:App之间的跳转-创新互联
分享链接:http://hbruida.cn/article/hphhh.html