Sgillon
Sgillon

Reputation: 147

Pre-poulating UItableview with Core Data

Core Data is a new concept for me, though I am familar with SQLite. I am trying to find a tutorial about how to populate a table onload with data from core data. I am creating a database with hundreds of fields which will have detail views. I understand how to create this with NSArray but I am not sure as to which method to use for pre-loading my database into the UItableView. Should I preload it into coredata(which I read was possible) and then load it in? The UITableView is a static non-editable table. I want to include core data as it seems from my reading that it is taking over from SQL and is a more effective method to use. Below is a crude example of what I am trying to recreate.

Im looking to recreate this

I understand how to load arrays into the TableView with NSArray arrayWithObjects but this is not suitable for my purpose, nor is plist.

I did see an Apple Sourecode App called 'Recipe Book' that achieves what I am after but I was hoping there would be a source that could had broken down its creation or a similar tutorial.

So to clarify my question, I am looking as to the best method to pre-populate the UItableView from a database and if there are any handy tutorials about how to achieve this as the ones I have completed didn't provide what I was looking for.

Any suggestions?

Upvotes: 0

Views: 1483

Answers (1)

taffarel
taffarel

Reputation: 4045

NSFetchedResultController is your friend.

I hope this Apple sample will be a good starting point for you. Also you can take a look to Ray Wanderlich good example of NSFetchedResultController

Upvotes: 3

Related Questions