0

I am using xCode 7 beta and swift, and storing my data using Parse.com. In which method in the UITableViewController should I be asking for data from my database? I need to ensure it is all present by the point in the lifecycle of the controller at which the cells need to be presented.

Is there anyway to guarantee this if I am loading data asynchronously?

2 Answers 2

1

viewDidLoad would be a good place for this but there might be a few second difference between displaying a blank tableView and when it gets populated depending on how long it takes to pull your data.

So in viewDidLoad you'll tell the Parse SDK to pull data and when it's complete, you can call [self.tableView reloadData]

Sign up to request clarification or add additional context in comments.

Comments

1

You should be asking for your data before the tableview is shown. That way you can pass your cells the ParseObject within the cellForIndexPath function. Then within your cell you can go ahead and get other information from ParseObject such as fetching relations or PFFIles etc

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.