Sharlon M. Balbalosa
Sharlon M. Balbalosa

Reputation: 1309

How to paginate data using NSIndexPath (CoreData)

I have a table view controller which list the contents of an entity in Core Data, after cell click it fetches the details of that particular entity using NSIndexPath and and push data to another view controller for detailed summary, in that view controller I want to paginate all the contents of that entity so that it is not hassle for the user to go back and select another data from the table. What is the best solution for this? Thank You!

Upvotes: 0

Views: 283

Answers (1)

One option would be to pass the array of items that the table is using for a datasource to the new view controller, along with the index of the selected item. When the user hits next or previous, they'll be able to traverse the array by just increasing or decreasing the current index of the item being viewed and refreshing the view with the new object's data.

Upvotes: 1

Related Questions