1.prepareForSegue:

Now we know what the destinationViewController is we can set its data properties. To receive information back from a scene we use
delegation. Both are shown simply in the following code snipped.

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if([[segue identifier] isEqualToString:@"ContactsViewControllerSegue"]){
ContactsViewController *cvc = (ContactsViewController *)[segue destinationViewController];
cvc.contacts = self.contacts;
cvc.delegate = self;
}
}

A final note about UIStoryboardSegue is that when you choose a popover transition you must get access to the popover in order to dismiss it. You can get this by casting the Segue to a UIStoryboardPopoverSegue but only after you have checked the identity of
the Segue to ensure you are making the correct cast.

2.UITableViewCell:

 static NSString *CellIdentifier = @"ContactsCell";
ContactsTableViewCell *cell = (ContactsTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell.contact = [contacts objectAtIndex:indexPath.row];

Note: That you can have as many different prototype cells as you wish the only requirement is that you set each one with a unique cell identifier.

It is also possible to create Segues between cells and ViewControllers to transition to a new scene when a cell is tapped. In the following screen shot you can see how to connect a cell to a UIViewController and by specifying Push as the transition mode we
now have a detailed view pushed on whenever a cell is tapped.

3.UIViewController:

UIStoryboard is a runtime representation of everything configured inside Interface Builder as such any individual scene can be loaded using either,

[UIStoryboard instantiateInitalViewController]
[UIStoryboard InstantiateViewControllerWithIdentifier]

Should you choose to split your application across multiple Storyboards these can be loaded using,

[UIStoryboard storyboardWithName:bundle:]

Storyboard 经常用法总结-精华版的更多相关文章

  1. 一看就懂的ReactJs入门教程(精华版)

    一看就懂的ReactJs入门教程(精华版) 现在最热门的前端框架有AngularJS.React.Bootstrap等.自从接触了ReactJS,ReactJs的虚拟DOM(Virtual DOM)和 ...

  2. ReactJs入门教程-精华版

    原文地址:https://www.cnblogs.com/Leo_wl/p/4489197.html阅读目录 ReactJs入门教程-精华版 回到目录 ReactJs入门教程-精华版 现在最热门的前端 ...

  3. Java Web项目案例之---登录和注册(精华版)

    登录和注册(精华版) (一)实现功能 1.使用cookie记录登录成功的用户名,用户选择记住用户名,则用户再次登录时用户名自动显示 2.实现文件上传功能(上传文件的表单上传于普通的表单上传不同,必须是 ...

  4. 【知识学习】Sublime Text 快捷键精华版

    Sublime Text 快捷键精华版 Ctrl+Shift+P:打开命令面板 Ctrl+P:搜索项目中的文件 Ctrl+G:跳转到第几行 Ctrl+W:关闭当前打开文件 Ctrl+Shift+W:关 ...

  5. sqlalchemy精华版

    上一篇主要粗略讲了Flask+mysql+sqlalchemy的使用,这次精讲下sqlalchemy的用法,话不多说,上代码. ----------sqlalchemy_test.py # -*- c ...

  6. java多线程(精华版)

    在 Java 程序中使用多线程要比在 C 或 C++ 中容易得多,这是因为 Java 编程语言提供了语言级的支持.本文通过简单的编程示例来说明 Java 程序中的多线程是多么直观.读完本文以后,用户应 ...

  7. Swift - 故事板storyboard的用法

    故事板(UIStoryboard)可以很方便的进行界面的设计,下面总结了常用的几个操作方法: 1,初始场景 选中View Controller,在属性面板里勾选Is Initial View Cont ...

  8. 黑马程序员_Java基础视频-深入浅出精华版--视频列表

    \day01\avi\01.01_计算机基础(计算机概述).avi; \day01\avi\01.02_计算机基础(计算机硬件和软件概述).avi; \day01\avi\01.03_计算机基础(软件 ...

  9. 课程2:《黑马程序员_Java基础视频-深入浅出精华版》-视频列表-

    \day01\avi\01.01_计算机基础(计算机概述).avi; \day01\avi\01.02_计算机基础(计算机硬件和软件概述).avi; \day01\avi\01.03_计算机基础(软件 ...

随机推荐

  1. ClassLoader载入指定的类需注意六个细节或报ClassNotFundEception异常总结

    项目中,载入指定的类反射调用方法一直报类找不到,经过数百次的測试.对这样的问题有了一个又一次的认识,特总结.记录.分享例如以下: 1.路径中尽可能用"/"或者File.separa ...

  2. 在SharePoint 2013 中使用文档库Scheduling (计划公布功能)

    本文讲述在SharePoint2013 中使用文档库Scheduling (计划公布功能)的步骤和注意的事项. 文档库Scheduling (计划公布功能) 用于设定当文档通过审批后特定的时间区间内才 ...

  3. Twenty Newsgroups Classification任务之二seq2sparse

    seq2sparse对应于mahout中的org.apache.mahout.vectorizer.SparseVectorsFromSequenceFiles,从昨天跑的算法中的任务监控界面可以看到 ...

  4. 改动导航栏上返回button上的字,比如把back改动为返回

    改动导航栏上返回button上的字,比如把back改动为返回 注意:这个须要在跳转之前到视图控制器中写,而不是在跳转之后到控制器中写 UIBarButtonItem *backIetm = [[UIB ...

  5. tcp接收xml数据解析

    避免tcp接收xml数据时加上xml数据长度,根据xml数据特点来解析recv到的xml数据 int nPos1 = 0; int nPos2 = 0; int nTempPos = 0; int n ...

  6. EasyUI - DataGrid 组建 - [ 组件加载和分页 ]

    效果: 原理:通过POST传递到数据后台字段. 此时上传的参数,page:当前页数,rows:每页显示的页数. 有此两项参数,计算取出数据条数. 通过后台接受参数,进行处理并返回抽取的数据. html ...

  7. 时间戳timestamp

    1 时间戳 数据库中自动生成的 唯一的 二进制的数据,通常用作给数据表的行添加版本戳的机制. timestamp与时间和日期无关. timestamp存储大小为8字节. 一个数据表只能有一个times ...

  8. ArcGIS 10.3 for Desktop新特性介绍

    ArcGIS 10.3是一个完整公布的ArcGIS平台,它包含新的产品(ArcGIS Pro),针对10.2版本号产品进行了功能增强和稳定性的改进. ArcGIS 10.3 for Server新特性 ...

  9. Oracle 经常使用的改动语句

    一.表Table 測试表:MY_TEST_TABLE -- Create table create table MY_TEST_TABLE ( A VARCHAR2(30), B NUMBER(10) ...

  10. 刚開始学习的人制作VMOS场效应管小功放

    VMOS场效应管既有电子管的长处又有晶体管的长处,用它制作的功率放大器声音醇厚.甜美,动态范围大.频率响应好.因此近年来在音响设备中得到了广泛应用. 大功率的场效应管功率放大器.电.路比較复杂.制作和 ...