蓝懿iOS培训日志10 个人随笔(部分总结)

自习日,复习,做练习,咀嚼-消化-吸收

区分TableViewController和TableView:

TableViewController继承于UIViewController,而TableView继承于UIView,这和View于ViewController之间的关系差不多。每个ViewController都带了一个View,当那个View是TableView时,他就TableViewController

TV=TableView    TVC=TableViewController

tv拖进去 

1需要右键连两条线 2需要写俩协议 

3需要写dequeue 4需要拖进去cell并写上cell的identifier

 

TVC 不用右键连线  不用写协议(父类里已包含)  不用拖cell(自带cell但也需要写上identifier(标识))      

不用写dequeue 已写好

 

TVC用的会多些 淘宝 微博等  

TVC需要做的:

1,在storyBoard中删掉VC新建类TVC  

2,拖进TVC给其箭头

3,把拖进的TVC名字改成建的类TVC的名字(酱就关联上了) 

4, 给自带的cell写上标识identifier

 

如何添加NavigationController

有StoryBoard时:选中运行起来的第一个页面Pasted Graphic.tiff 

Pasted Graphic 1.tiff

会自动在第一个页面前加一个页面

Pasted Graphic 2.tiff

或者拖出来一个NavigationController然后删掉其拖出来时自带的rootViewController 点击Control连到想要第一个出现的页面,选择rootViewControl  

Pasted Graphic 1_1.tiff

self.title=@“XXX”;   设置标题

 

下图是在控制跳转页面到button里代码写出第二个页面然后跳转

Pasted Graphic 2_1.tiff

//使导航控制器返回   以下是不同的返回方式

1.跳到rootViewController

2.返回之前一步步过来的页面之一 例如:A页面-B页面-C页面   C可以跳到AorB

3.返回上一个页面

Pasted Graphic 5.tiff

 

 

 

               

 

 

 

posted @ 2015-09-12 17:21  咬一口程序猿  阅读(106)  评论(0编辑  收藏  举报