IOS跳转视图传参的几种方法
2015-10-19 08:23
411 查看
IOS视图间传参的方式
以下是iOS视图间传参几种方式:
1.属性传参;
2.委托delegate(协议);
3.notification(通知);
4.block方式;
场景一:A页面跳转到B页面
SecondViewController.h //第二个页面
以下是iOS视图间传参几种方式:
1.属性传参;
2.委托delegate(协议);
3.notification(通知);
4.block方式;
场景一:A页面跳转到B页面
SecondViewController.h //第二个页面
@interface SecondViewController : UIViewController @property(nonatomic,copy) NSString *flag;//在第二个页面提供属性 @end
<pre name="code" class="html"> //在第一个页面跳转页面并赋值 SecondViewController *secondController=[[SecondViewController alloc] init]; secondController.flag=@"我是flag"; [self.navigationController pushViewController:secondController animated:YES];
相关文章推荐
- IOS跳转视图传参的几种方法
- 猫猫学iOS之ipad开发qq空间项目横竖屏幕适配
- iOS各种调试技巧豪华套餐
- iOS开发之Present ViewController Modally --弹出模态ViewController
- C5-信号量与PV操作(iOS篇-细说信号量)
- IOS 分享 牛人 Demo
- ios输入内容正则表达式的应用
- iOS中AutoLayer自动布局流程及相关方法
- IOS 委托 1
- GitHub 上都有哪些值得关注学习的 iOS 开源项目?
- 国外iOS开发教程、博客、工具、文档类站点收集整理:
- ios开发六大必备工具
- iOS 多个view添加手势, 识别是哪个view的事件
- iOS之安全攻防
- IOS圆形头像的设置
- iOS中两种定时器的使用和区别
- 蓝懿ios 技术内容和心得 10。18
- iOS开发常用的集中设计模式
- IOS沙盒中的Documents、Library、tmp区别
- IOS开发中常用一下方法