Question

I used to use plists to store my app's data, but I have decided to use UIDocument instead. The first view is a UITableView, and the corresponding UIDocument needs to be loaded before the view appears.

I load and save my data in the app's delegate, but when I load my UIDocument, it only gets loaded (on a background queue, I think) after my table view appears, causing all kinds of errors.

So, how do I load it on the main queue, so that when it's loaded program execution can continue normally? The document isn't very big (only contains data of an array of string data), and so there won't really be any performance-related issues.

Was it helpful?

Solution

Are you using method -openWithCompletionHandler: to load the document? If this is the case, you will have to reload the table in the completion block.

The document is loaded on main thread, but later, than your table is displayed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top