I'm working on an app which allows users to send messages to people which can be selected from a variety of sections. One of these sections happens to be the contacts stored on the phone book (other contacts are selected from an online DB).
As such, I have a 'master list' of recipients. If the user, for example, chooses to select a contact from their online account, this will push a new view that will allow the user to select which contacts to add to the recipient list. When they go back to the master list, they should see the chosen participants selected there. If they were to return to add another person, the selected contacts should all be checked (each contact is displayed as a UITableViewCell).
This is working fine for all the online contacts however I'm having some issue implementing this functionality for local contacts using the ABPeoplePickerNavigationViewController. To check the selected contacts when the user returns to this screen, I need to have some way to now when the view has loaded.
Are any of the view delegates (i.e. ViewDidAppear) guaranteed to be called after the table has been loaded (I'm pretty doubtful on this one)?
If not, I had thought of counting the total number of rows in the datasource (using numberOfRowsInSection:) in a timer. If half a second or so has passed without the count incrementing, it should be a safe bet that all the records have been loaded. Somehow, however, I'm not so sure if this is going to work. It might be that all the records will be loaded in a single hit.
Any ideas on how to achieve this? Are my suggested methods workable? Is there a different workaround?