參考:Start Developing iOS Apps Today
介紹
環境安裝
教程: 基礎
構造App
App開發過程
設計使用者界面
定義互動
教程: 故事闆
如何設定主界面: 在項目浏覽器中選擇項目 -> 在相應的工作區間的Targets下選擇目标 -> Deployment Info -> 在Main Interface下拉清單中選擇想要的主界面.
實作App
與資料合并
使用設計模式
與Foundation一起工作
定制類
教程: 添加資料
下一步
iOS技術
查找資訊
從這裡到哪去
簡明ToDoList執行個體步驟
- 建立Empty Application (iOS) 應用程式
- 建立一個ViewController子類, 一個TableViewController子類{加入-(IBAction)unwindToList: (UIStoryboardSegue *)segue方法}
- 建立一個故事闆 (Main), 在故事闆中
- 建立一個Table View Controller -> 設定為自定義子類-> 嵌入到Navigation Controller -> 修改Navigation Item的Title, 并在右側插入一個Bar Button(Identifier設為Add)
- 建立一個View Controller -> 插入一個文本編輯框 -> 設定為自定義子類 -> 嵌入到Navigation Controller(AddNavigation) -> 修改Navigation Item的Title, 并在左側插入一個Bar Button(Title設為取消), 右側也插入一個(Title設為确定)
- 按住Control鍵, 拖拽TableViewController中的Add按鈕到AddNavigation, 建立Modal聯接
- 按住Control鍵, 拖拽ViewController中的"确定"、"取消"按鈕到Exit, 選擇unwindToList:
- 在項目浏覽器中, 選擇項目 -> Target -> Deployment Info -> Main Interface 修改為 Main;AppDelegate.m的application: didFinishLaunchingWithOptions:隻保留 Return YES;
- 到這裡, 應用程式可以在TableView和View兩者之間切換了
- 建立一個條目類, 含3個屬性 name, completed, createDate
- 在TableViewController中建立toDoItems數組(用來儲存條目), 設定相應的方法tableView: (numberOfSectionsInTableView:, cellForRowAtIndexPath:, cellForRowAtIndexPath:, unwindToList:)
- 在TableViewController中修改Table View Cell的Identifier
- 在ViewController中建立toDoItem屬性, textName屬性(名稱), btnOnOK屬性(用于退出時比較), 設定相應的方法prepareForSegue: sender:(儲存目前輸入)