星空网 > 软件开发 > 操作系统

UIView上的按钮跳转到一个控制器UIViewController上去

我现在有一个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上的按钮跳转到一个控制器UIViewController上去

关键词:ie

ie
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

Google论:https://www.goluckyvip.com/tag/15051.html
TikT:https://www.goluckyvip.com/tag/15052.html
Ahrefs:https://www.goluckyvip.com/tag/15053.html
SEO插件:https://www.goluckyvip.com/tag/15054.html
工具插件:https://www.goluckyvip.com/tag/15055.html
SEO优:https://www.goluckyvip.com/tag/15056.html
川藏线自驾游要怎么走才比较划算呢?:https://www.vstour.cn/a/411240.html
去日本入住酒店,东西随意用却有一个特殊“要:https://www.vstour.cn/a/411241.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流