【Sample Code】Configuring the Destination Controller When a Segue is Triggered
来源:互联网 发布:液流电池 知乎 编辑:程序博客网 时间:2024/06/04 16:29
iOS performs the following tasks when a segue is triggered:
It instantiates the destination view controller.
It instantiates a new segue object that holds all the information for the segue being triggered.
Note: Apopoverseguealsoprovidesapropertythatidentifiesthepopovercontrollerusedtocontrol the destination view controller.
It calls the source view controller’sprepareForSegue:sender:method, passing in the new segue objectand the object that triggered the segue.
It calls the segue’s performmethod to bring the destination controller onto the screen. The actual behaviordepends on the kind of segue being performed. For example, a modal segue tells the source view controllerto present the destination view controller.
It releases the segue object and the segue is complete.
Configuring the destination controller in a segue
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"ShowSightingsDetails"]) { DetailViewController *detailViewController = [segue destinationViewController]; detailViewController.sighting = [self.dataController objectInListAtIndex:[self.tableView indexPathForSelectedRow].row];} if ([[segue identifier] isEqualToString:@"ShowAddSightingView"]) { AddSightingViewController *addSightingViewController = [[[segue destinationViewController] viewControllers] objectAtIndex:0]; addSightingViewController.delegate = self;} }
- 【Sample Code】Configuring the Destination Controller When a Segue is Triggered
- 【Sample Code】Custom Segue
- the code is a mock one
- A new start begins when the offer is declined
- destination exists and is not a directory
- 【View Controller】Configuring the Initial View Controller at Launch
- Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE
- Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE
- Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE
- The run destination''''is not valid for Running the scheme
- The following code fails when ExecMethod is called. Can anyone pinpoint what I am doing wrong?
- No orientation specified, and the default is horizontal. This is a common source of bugs when ...
- when a child is born
- When a child is born
- when a child is born
- When is a destructor called?
- When is a destructor called?
- PostBack the form when a value is selected from the results returned by autocomplete extender
- hdu1698 Just a Hook
- JavaScript: 判断一个变量的类型
- VS2010 经常崩溃的一次解决办法
- OC与JAVA通用的AES加密解密
- C++ primer 第五版 中文版 练习 11.20 个人code
- 【Sample Code】Configuring the Destination Controller When a Segue is Triggered
- Pascal's Triangle Pascal's Triangle||
- SuperSocket服务器架设(二):使用SuperSocket构建简单服务器
- 结构之美:单链表的头结点与头指针
- 网页爬虫之邮件获取
- Codeforces Round #268 (Div. 1)B(dfs)
- Oracle集群-搭建系列-文章目录(V2014-9)
- android 开发用到的一下工具
- 读编程思想3-5章