开发者

add row uitableview-coreData

开发者 https://www.devze.com 2023-02-14 08:35 出处:网络
I have a table view, and I want to add a row, and save it to coredata. So is this a good practice: when user clicks the \"plus button\" on navigation bar, on the screen will appear new view controll

I have a table view, and I want to add a row, and save it to coredata. So is this a good practice: when user clicks the "plus button" on navigation bar, on the screen will appear new view controller, where user can write required data for new row. When the user clicks "done" button, controller by delegation will trigger an addRow method (from R开发者_JAVA百科ootViewController) which save data to database.


Yes, it does seem fine. The delegation is also responsible for the table view reloading once you added new entry, if your data source is stored in NSArray or other collection.

If you use NSFetchedResultsController, it will reload automatically once detects the changes made to Core Data entity.

0

精彩评论

暂无评论...
验证码 换一张
取 消