iOS 程序间跳转传参(支付和地图)
两个APP之间的跳转是通过[[UIApplication sharedApplication] openURL:url]这种方式来实现的。
1.首先设置第一个APP的url地址

2.接着设置第二个APP的url地址

3.需要跳转的时候
NSString *urlString = [NSString stringWithFormat:@"AppJumpSecond://%@",textField.text];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];
我这里将textField的文字也传过去
同样的,在第二个页面也是如此
NSString *urlString = [NSString stringWithFormat:@"AppJumpFirst://%@",textField.text];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];
这样就能相互跳转了
4.处理传过去的数据
在上面传了textField的数据,接收时在AppDelegate的
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation方法里。
在AppDelegate里设置属性
@property (nonatomic, strong) RootViewController *rvc;
在didFinishLaunchingWithOptions方法里添加
self.rvc = [[RootViewController alloc] init];
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:self.rvc];
self.window.rootViewController = nc;
添加代码块
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
self.rvc.textField.text = [[url host] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
return YES;
}
使得textField显示另一个页面传过来的数据。
iOS 程序间跳转传参(支付和地图)的更多相关文章
- 小程序页面跳转传参-this和that的区别-登录流程-下拉菜单-实现画布自适应各种手机尺寸
小程序页面跳转传参 根目录下的 app.json 文件 页面文件的路径.窗口表现.设置网络超时时间.设置多 tab { "pages": [ "pages/index/i ...
- 微信小程序页面跳转传参
1.传递参数方法 使用navigatior组件 <navigator url="/pages/pull/pull?title=lalla&name=cc" hov ...
- 微信小程序页面跳转传参方式
//实现跳转的A页面 jump: function () { let a = 1; let b = 2; wx.navigateTo({ url: '/page/vipOrder/vipOrder?d ...
- 三十七、小程序页面跳转传参参数值为url时参数丢失
当参数的值为url的时候,在options中的值没有参数“?”之后字符串被截取.例如:let url="http://baidu.com/?a=1&b=2"wx.navig ...
- 小程序页面跳转传参参数值为url时参数时 会出现丢失
当参数的值为url的时候, ?号 _ 下划线 等等 都会被 截取掉,看不到, 这样在 另一个页面 options中 截取的url就不完全 let url="http://ba ...
- 微信小程序~跳页传参
[1]需求: 点击商品,跳到相应商品详情页面 [2]代码: (1)商品列表页 <view class="goodsList"> <view wx:for=&quo ...
- 应用程序间跳转 (友盟SSO 授权 与系统自带的分享)
应用程序间跳转的应用场景 使用第三方用户登录,如微信登录,返回用户名和密码 需要用户授权,返回到调用程序,同时返回授权的用户名 应用程序推广,跳转到itunes并显示指定app下载页 第三方支付,跳转 ...
- vue路由(一个包含重定向、嵌套路由、懒加载的main.js如下)and 路由跳转传参的query和params的异同
import Vue from 'vue'import VueRouter from 'vue-router'import App from './App'Vue.use(VueRouter)cons ...
- vue 页面跳转传参
页面之间的跳转传参,正常前端js里写 window.location.href="xxxxx?id=1" 就可以了: 但是vue不一样 需要操作的是路由history,需要用到 V ...
随机推荐
- VituralBox 虚拟机网路设置 主机无线
主机和虚拟机都关闭防火墙 主机和虚拟机可以互相ping通 主机和虚拟机都可以联网 如果出现 ‘device not managed by NetworkManager’ 错误 network服务器 ...
- CAFFE中训练与使用阶段网络设计的不同
神经网络中,我们通过最小化神经网络来训练网络,所以在训练时最后一层是损失函数层(LOSS), 在测试时我们通过准确率来评价该网络的优劣,因此最后一层是准确率层(ACCURACY). 但是当我们真正要使 ...
- /etc/rc.local 与 /etc/init.d Linux 开机自动运行程序
1. /etc/rc.local 这是使用者自订开机启动程序,把需要开机自动运行的程序写在这个脚本里 --------引用---------------------- 在完成 run level 3 ...
- SmtpDlg 调用SMTP
// SmtpDlg.h : 头文件 // #pragma once #include "afxwin.h" #include "string" using n ...
- nuget pack 时不包含依赖包(而不是引用项目的dll,区别于IncludeReferencedProjects)
Excluding development dependencies when creating packages Some NuGet packages are useful as developm ...
- Form表单的post 和get跳转区别
post是隐示请求 ----- 安全 get显示请求不安全,会在URL上显示路径和参数
- oracle 常用sql语句
oracle 常用sql语句 1.查看表空间的名称及大小 select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_sizefrom d ...
- sqlserver 2008 查看表描述,和表结构
sp_help sys_user sp_columns sys_user --表结构 THEN obj.name ELSE '' END AS 表名, col.colorder AS 序号 , c ...
- github入门操作
一.更新github上的已有项目: 将repository clone到本地 shanyu@debian:~/Git$ git clone https://github.com/xunbu7/Hell ...
- margin:0 auto
<!doctype html> <html> <head> <meta charset="utf-8"> <title> ...