zoukankan      html  css  js  c++  java
  • ##DAY14——StoryBoard

    •iOS下可视化编程分为两种⽅式:xib和storyboard。

    •在使用xib和storyboard创建GUI过程中,以XML文件格式 存储在Xcode中,编译时生成nib的二进制文件。在运行时, nib⽂件被加载并且开始创建和实例化GUI元素。

    //当stroyboard通过页面跳转时,此方法就会执行
    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
        //segue有三个非常重要的属性
        /*
         1、identifier,标识符,标识区份线(segue),可以选择性的跳转
         2、sourceViewController,源视图控制器
         3、destinationViewController,目标视图控制器
         */
        if([segue.identifier isEqualToString:@"secondVC"]){
            SecondViewController *secondVC = segue.destinationViewController;
            secondVC.string = self.usernameTF.text;
            
        }
    }
    - (IBAction)regist:(id)sender {
        //每一个视图控制器都有一个属性叫storyboard,可以找到当前视图控制器交由哪个故事板管理。并且故事板可以通过storyboardID来找到加到其内部的视图控制器
    //    UIViewController *controller =
    //    [self.storyboard instantiateViewControllerWithIdentifier:@"second"];
    
    //    [self presentViewController:controller animated:YES completion:nil];
        
        [self performSegueWithIdentifier:@"secondVC" sender:nil];
    }
  • 相关阅读:
    oracle常用hint的用法
    浅谈reverse函数与django哲学
    javascript console
    python os.path模块
    删除列表元素
    Python模块学习 pickle, cPickle 对象序列化/反序列化
    Python中zip()函数用法举例
    Python 字符串方法详解
    常用正则验证
    python中下划线的用法
  • 原文地址:https://www.cnblogs.com/chongyu/p/5209447.html
Copyright © 2011-2022 走看看