IOS7 随记(一)之unwind segue
来源:互联网 发布:软件著作权打印要求 编辑:程序博客网 时间:2024/05/01 19:42
关于auto lay out,unwind segue,tiff,静态显示tableView内容,返回类型:instancetype and id
1.Auto Lay Out:
a.选中控件,control-dray,分别从四个方向释放鼠标,会出现相对应方向的关于constraint的shortcut菜单
b.或是从顶部菜单 Editor - Resolve Auto Layout Issues - Reset to Suggested Constraints
Editor - Resolve Auto layout Issues - Clear Constraints
2.unwind segue to navigate back:
a-push/modal segue to-b,b-unwind segue to-a
在a中定义(.h)- (IBAction)unwindToA:(UIStoryboardSegue *)unwindSegue;
(.m)- (IBAction)unwindToA:(UIStoryboardSegue *)unwindSegue
{
UIViewController* sourceViewController = unwindSegue.sourceViewController; //sourceViewController:b
if ([sourceViewController isKindOfClass:[B class]])
{
......//事先可以sourceViewController(即b)中声明可公开访问的属性,以便在此可访问到
}
}
在main.storyboard中,将b中navigation bar上的按钮 control-drag到exit上(视图控制器界面上下方最右边绿色图标 ),在弹出的shortcut菜单上选中刚才设置的unwindToA,之后在运行时点击此按钮,即可返回
p.s.在http://stackoverflow.com/questions/12561735/what-are-unwind-segues-for-and-how-to-use-them中有更详细描述
3。在mac中抓图:
Launchpad-其他-抓图,完成后,文件是保存为tiff格式,双击此文件,在预览中把文件导出为png,就可当图像使用了
4.静态显示UITableView内容:
a.TableView - Content:Static Cells
b.Table View Cell - Style:Basic
c.注释方法-numberOfSectionsInTableView:, tableView:numberOfRowsInSection:, tableView:cellForRowAtIndexPath:.
5.返回类型:instancetype and id
凡是通过alloc,init,new方式返回对象时,返回类型要用instancetype(而不是用id)
e.g.
@interface MyObject
+(instancetype)myFactoryMethod;
@end
@implementation MyObject
+(instancetype)myFactoryMethod {
return [[[self class] alloc] init] ; //要用self,这样才可以在其子类中也适用
}
@end
- IOS7 随记(一)之unwind segue
- swift创建unwind 过渡(unwind segue)
- swift创建unwind 过渡(unwind segue)
- 非常好用的 unwind segue
- IOS-笔记15(Unwind Segue,Action Sheets,Alert,NSTimer)
- Unwind Segue not working in iOS 8
- iOS开发使用Unwind Segue进行返回
- iOS normal segue 与 unwind segue 的区别
- Unwind Segue的工作原理和Modal presentation与Unwind segue的区别
- Unwind Segue not working in iOS 8问题解决
- 自学Swift-斯坦福笔记整理(十一) Unwind segue alert
- [转]swift, unwind segue回传数据
- IOS7 随记(二)之injection 插件(实时修改运行)
- 随记录 之 Spring 自学笔记(一) -- IOC(一)
- IOS Modal Segue和Unwind Segue的使用Demo-附完整工程
- 随记(一)
- 孕妇随记(一)
- 学习随记(一)
- C#读取txt文件的两种方法
- 织梦(dedecms)系统常用全局变量调用标签及路径
- 广电网络使用VisualNet动态显示信息变化
- 6 . 3 . 2 名字的隐藏
- Java过滤掉非UTF-8字符方法
- IOS7 随记(一)之unwind segue
- C++ map的基本操作和使用
- 6 . 4 到底选择合成还是继承
- 常用的正则表达式
- Makefile选项CFLAGS,LDFLAGS,LIBS....
- 6 . 5 p r o t e c t e d
- python学习笔记(一)
- define的用法与注意事项
- 6 . 6 累积开发