CoreData 入門使用 增刪改查 swift

來源:互聯網
上載者:User

標籤:

  1. 首先建立一個

  2. 點擊建立的testInfo.xcdatamodeld 會出現這麼個介面

  3. 建立完testInfo.xcdatamodeld之後 AppDelegate 會自動幫你添加支援coredata的代碼 有興趣的自己研究

  4. 首先 使用coredata 儲存資料 1.建立表 2.建立欄位 3.建立對應欄位的模型類 就足夠了

  5. 建立表 點擊 然後出現  

  6. 添加欄位 ....................

  7. 建立對應欄位的模型  command+n 

  8. 都勾上之後會自動幫你建立一個類 

  9. 好 一切準備完畢.  找個地方測試一下  增刪改查  就直接在 AppDelegate裡寫測試代碼



好 以上就是簡單的coredata使用  獻給第一次用的新手.  本執行個體只試用於入門上手使用  


CoreData 入門使用 增刪改查 swift

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.