last day (15 days later) » 

8:19 PM
0
A: TableViewController wait loading data before objectAtIndex

medaPerhaps you can toggle on and off user interaction, until data is received and reloaded? self.tableView.userInteractionEnabled = false Also move self.loadData() to viewDidLoad you don't need to re-download each time you go back

 
It's an idea, but I'm sure there is better things to do... I heard about asynchronously loading, what's that ? Also, if I try your solution, how I can know if data are received or not ?
 
Aren't you downloading data asynchronously? it just mean you start a background thread to download data this way you dont block the UI thread. When that happens its up to you display a message for example loading data.. then once completed reload and allow interaction
 
Yes, in fact it's already async. How can I wait the data is loaded to display the list of cell ?
 
the list of cell will not display until the tableView is reloaded. My suggestion is to show activity indicator + disable interaction untill reloaded then hide indicator an reenable the interaction. does it make sense ?
@user2178964 Also move self.loadData() to viewDidLoad you don't need to re-download each time you go back
 
In fact I agree it's a better solution to put the loadData method in viewDidLoad method. But how reload data after a adding action or delete action. For example I click on "Add", I add m'y alert, I'm redirected on the master view controller, but I tell him to reload ?
I've added the add controller code
 
8:34 PM
ping me when you here
I think you need do what I suggest
at least you should try
or in did select add a check on the array
good luck
 
8:46 PM
I'm here
Thanks for your help
I think put the loadData method in viewDidLoad is really a good solution.
But next, I need to specify to the controller to reload Data after adding or delete something...
Which code let me do that in the AddViewController ?
 

last day (15 days later) »