1.3.1. 新建Xcode项目并设置故事板(Core Data 应用程序实践指南)

时间:2023-03-09 03:35:01
1.3.1. 新建Xcode项目并设置故事板(Core Data 应用程序实践指南)

  创建名为Grocery Dude的Single View程序,并按默认设置处理,不勾选Core Date 和 Git。

  设计故事板:

  1. 选择Main.Storyboard
  2. 拖放一个 Table View Controller 到故事板中
  3. 选中新拖入的Table View Controller
  4. 勾选 “Is initial View Controller”
  5. 选中 Table View Controller 并点击Editor > Embed In > Navigation Controller
  6. 拖放 Bar Button Item 到 Table View Controller的右上角
  7. 选中 Bar Button Item
  8. 改属性 “Identifier” 为 "Add"
  9. 按住Control键,把 Bar Button Item 拖到View Controller中心,选择 "Action Segue" > "push"
  10. 选中 “Action Segue”,改属性 “Attributes Inspector”的 “Identifier”为 “Add Item Segue”
  11. 选中 Table View 的 Prototype Cell
  12. 修改 “Style” 为 “Basic”
  13. 修改 “Identifier” 为 “Item Cell”