码迷,mamicode.com
首页 > 移动开发 > 详细

ios - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender 的写法

时间:2016-08-09 09:29:30      阅读:259      评论:0      收藏:0      [点我收藏+]

标签:

写法1:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
    if ([segue.identifier isEqualToString:@"ProjectDetailsSegue"]) {
        ProjectDetailsViewController *detailsVC = segue.destinationViewController;
        detailsVC.idString = sender;
    }

写法2:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
    if ([[segue destinationViewController] isKindOfClass:[EZWifiConfigViewController class]]) {
        ((EZWifiConfigViewController *)[segue destinationViewController]).ssid = self.nameTextField.text;
        ((EZWifiConfigViewController *)[segue destinationViewController]).password = self.passwordTextField.text;
    }
}

 

ios - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender 的写法

标签:

原文地址:http://www.cnblogs.com/codemakerhj/p/5751744.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!