IOS-TODOLIST
2016-01-13 20:52
323 查看
sb上先加入NavigationController ,拖拽TABLEVIEW上去,上面再放入Navigation Item (里面放入Bar Button Item)。
注意新建立了一个
UITableViewController的类绑定到TABLEVIEW
点击某行,进入新界面:
主意新界面要去设置identifier 为tododetail
override func tableView(tableView:
UITableView, didSelectRowAtIndexPath indexPath:
NSIndexPath) {
NSLog("click is:\(indexPath.row)")
var viewController =
self.storyboard?.instantiateViewControllerWithIdentifier("tododetail")
as!ViewController
viewController.rowIndex = indexPath.row
self.navigationController?.pushViewController(viewController, animated:
true)
}
明细页面,LABLE的OUTLET是使用CTROL拖拽法自己生成的
var rowIndex =
0;
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
labe1.text =
"Row index is:\(rowIndex)"
}
@IBOutlet
weak var labe1:
UILabel!
注意新建立了一个
UITableViewController的类绑定到TABLEVIEW
点击某行,进入新界面:
主意新界面要去设置identifier 为tododetail
override func tableView(tableView:
UITableView, didSelectRowAtIndexPath indexPath:
NSIndexPath) {
NSLog("click is:\(indexPath.row)")
var viewController =
self.storyboard?.instantiateViewControllerWithIdentifier("tododetail")
as!ViewController
viewController.rowIndex = indexPath.row
self.navigationController?.pushViewController(viewController, animated:
true)
}
明细页面,LABLE的OUTLET是使用CTROL拖拽法自己生成的
var rowIndex =
0;
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
labe1.text =
"Row index is:\(rowIndex)"
}
@IBOutlet
weak var labe1:
UILabel!
相关文章推荐
- iOS----收集的一些小技巧
- iOS中关于动态Tableview中的cell数据传输的多线程问题解决之拙见
- ios开发 只让播放视频的 时候能够全屏横屏 其他全部非全屏非横屏
- NSURLConnect 的简单实用(iOS8淘汰)
- iOS 自定义navigationBar上得字体属性
- iOS之OC源码,相册循环查看功能的实现
- IOS之OC源码相册循环查看图片功能的实现
- IOS源码之OC相册,可以循环查看图片
- IOS矩阵之后的数学知识
- Runtime Method Swizzling
- iOS中跳转到系统应用的问题
- IOS APN的push证书转换
- Xcode7适配iOS9遇到的一些问题及解决办法
- iOS --NSPredicate
- iOS 4种传值总结
- iOS真机运行,出现process launch failed: Security 错误
- iOS手势以及手势冲突问题
- iOS 导航栏全透明设置
- iOS-修改Status Bar
- ios 视频,音频,开发详解