iOS: 今天开始App(Start Developing iOS Apps Today)

来源:互联网 发布:淘宝怎么修改当前主营 编辑:程序博客网 时间:2024/05/17 22:51

参考:Start Developing iOS Apps Today

介绍

环境安装

教程: 基础

构造App

App开发过程

设计用户界面

定义交互

教程: 故事板

如何设置主界面: 在项目浏览器中选择项目 -> 在相应的工作区间的Targets下选择目标 -> Deployment Info -> 在Main Interface下拉列表中选择想要的主界面.

实现App

与数据合并

使用设计模式

与Foundation一起工作

定制类

教程: 添加数据

下一步

iOS技术

查找信息

从这里到哪去

简明ToDoList实例步骤

  1. 创建Empty Application (iOS) 应用程序
  2. 创建一个ViewController子类, 一个TableViewController子类{加入-(IBAction)unwindToList: (UIStoryboardSegue *)segue方法}
  3. 创建一个故事板 (Main), 在故事板中
    1. 创建一个Table View Controller -> 设置为自定义子类-> 嵌入到Navigation Controller -> 修改Navigation Item的Title, 并在右侧插入一个Bar Button(Identifier设为Add)
    2. 创建一个View Controller -> 插入一个文本编辑框 -> 设置为自定义子类 -> 嵌入到Navigation Controller(AddNavigation) -> 修改Navigation Item的Title, 并在左侧插入一个Bar Button(Title设为取消), 右侧也插入一个(Title设为确定)
    3. 按住Control键, 拖拽TableViewController中的Add按钮到AddNavigation, 建立Modal联接
    4. 按住Control键, 拖拽ViewController中的"确定"、"取消"按钮到Exit, 选择unwindToList: 
  4. 在项目浏览器中, 选择项目 -> Target -> Deployment Info -> Main Interface 修改为 Main;AppDelegate.m的application: didFinishLaunchingWithOptions:只保留 Return YES;
  5. 到这里, 应用程序可以在TableView和View两者之间切换了
  6. 创建一个条目类, 含3个属性 name, completed, createDate
  7. 在TableViewController中创建toDoItems数组(用来保存条目),  设置相应的方法tableView: (numberOfSectionsInTableView:, cellForRowAtIndexPath:,  cellForRowAtIndexPath:, unwindToList:)
  8. 在TableViewController中修改Table View Cell的Identifier
  9. 在ViewController中创建toDoItem属性, textName属性(名称), btnOnOK属性(用于退出时比较), 设置相应的方法prepareForSegue: sender:(保存当前输入)

原创粉丝点击