UIStoryboard 初始化数据

来源:互联网 发布:网络语沙发是什么意思 编辑:程序博客网 时间:2024/06/17 10:09

// 初始化 一 :

// //当self 不是storyboard 时候,就要先找到mainStoryBoard  然后通过mainstoryboar 开始去初始化

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];

    // 从Storyboard上按照identifier获取指定的界面(VC),identifier必须是唯一的

ReceiveViewController *receive = [storyboard instantiateViewControllerWithIdentifier:@"IdReceive"];


// 初始化 二 :

//当self 是storyboard 时候就可以这样初始化

self.blueVC = [self.storyboardinstantiateViewControllerWithIdentifier:@"Blue"];


0 0