您的位置:首页 > 移动开发 > IOS开发

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!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: