UIView上的按钮跳转到一个控制器UIViewController上去
2016-01-31 02:16
429 查看
我现在有一个UIControllerView 里面addView了一个UIView,我在点击UIView的时候转到另一个UIControllerView,按上面的导航条上面的返回按钮返回第一个UIControllerView,在那个UIView里怎么用pushViewController
在UIView里发送消息
[[NSNotificationCenter defaultCenter] postNotificationName:@"push" object:nil];
在父类控制器接收消息并
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pushOne) name:@"push" object:nil];
-(void)pushOne
{
YYCSettingController *setting=[[YYCSettingController alloc]init];
[self.navigationController pushViewController:setting animated:YES];
}
发送消息
[[NSNotificationCenter defaultCenter]
postNotificationName:@"chuandi" object:self];
接收消息 自己写个action的动作
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(action)
name:@"chuandi" object:nil];
比如你在 一个子类里触发一个事件后 把消息传递到父类 在父类里的action 指向 推向另一个子类 就可以把
在UIView里发送消息
[[NSNotificationCenter defaultCenter] postNotificationName:@"push" object:nil];
在父类控制器接收消息并
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pushOne) name:@"push" object:nil];
-(void)pushOne
{
YYCSettingController *setting=[[YYCSettingController alloc]init];
[self.navigationController pushViewController:setting animated:YES];
}
发送消息
[[NSNotificationCenter defaultCenter]
postNotificationName:@"chuandi" object:self];
接收消息 自己写个action的动作
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(action)
name:@"chuandi" object:nil];
比如你在 一个子类里触发一个事件后 把消息传递到父类 在父类里的action 指向 推向另一个子类 就可以把
相关文章推荐
- jfinal2.2+easyui1.4.4后台权限管理系统 [2016.01.31 更新]
- 利用values来反向查询key,有没有简单的方法呢?
- uicollectionview的基本使用
- 网卡解析arp协议导致ip address ** is already in ues for...
- LeetCode 303:Range Sum Query - Immutable
- 集训队专题(2)1004 Queuing
- lintcode: Unique Paths
- Divide and conquer:Showstopper(POJ 3484)
- Implement Queue by Two Stacks
- UISegmentedControl分段控件使用详解
- UISegmentedControl 分段控件-IOS开发
- TraitsUI-轻松制作用户界面
- 升级后重启造成fsck.ext3: Unable to resolve UUID
- Wunder Fund Round 2016 (Div. 1 + Div. 2 combined) B Guess the Permutation (两种做法,水题的一点点思考)
- [转]easyui tree 模仿ztree 使用扁平化加载json
- tkinter的GUI设计:界面与逻辑分离(四)-- 与 matplotlib 结合
- 【POJ】[2524]Ubiquitous Religions
- 继承Volley的Request<T>,创造自己的Request,实现cookie回调和指定返回数据类型回调
- POJ 3085:Quick Change
- zoj 2966 Build The Electric System【最小生成树 Kruskal && prim】