Do I have to create some dummy hardcoded array wit

2019-09-04 12:27发布

How to create a UITableViewController that displays some hardcoded data in grouped styled (like iPhone settings). For example I need to show some menu options in a table with group style. Now, I know to work with tables and have done it already. But I'm not sure about how should I deal with data that table view will read for constructing the table. Those rows just present some menu options like "order", "review", "about us" then IMHO I have to create some array with that data and store in NSUserDefaults. Am I right?

1条回答
兄弟一词,经得起流年.
2楼-- · 2019-09-04 13:16

Create a plist file of your data. It can include arrays of items for each group. Included the plist in your project and read it in for use by your datasource. That creates a nice decoupling of data from UI.

查看更多
登录 后发表回答