App之間的跳轉(zhuǎn) 成都創(chuàng)新互聯(lián)專注于新賓企業(yè)網(wǎng)站建設(shè),響應(yīng)式網(wǎng)站建設(shè),商城網(wǎng)站制作。新賓網(wǎng)站建設(shè)公司,為新賓等地區(qū)提供建站服務(wù)。全流程定制設(shè)計(jì),專業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,成都創(chuàng)新互聯(lián)專業(yè)和態(tài)度為您提供的服務(wù) 1,添加URL Types項(xiàng) a,打開項(xiàng)目中.xcodeproj下的info目錄,增加一項(xiàng)URL Typs  2,配置URL Scheme a,將URL identifie選項(xiàng)為com.KeYi.lsf
b,將URL Scheme選項(xiàng)的內(nèi)容修改為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; } } ... }
|