Have you tested the sequence in which these events occur? Does the reallocate method return before the data model has been updated (or its updating has completed?). Just log when the reloadData method starts and log when updating the data model finishes. Maybe the latter happens later than the former? Even though in code that should not be happening? If so, try deferring the reloadData method call with 0.25 or .3 seconds and see what happens.
I came across a didRotateNotification that has a similar issues and where I expected it to call the method that updates the interface when rotating completely finished. Instead, the interface was updated just a tiny bit too quickly. So, for completeness' sake, try looking at the sequence in time... > >> On Feb 12, 2016, at 1:39 PM, Quincey Morris >> <quinceymor...@rivergatesoftware.com> wrote: >> >> I think the one thing you can count on is that the âreloadDataâ API >> isnât broken. > > But it's very tempting to think so... ;-) > > When I issue the -reloadData, the -tableView:numberOfRowsInSection: > callback gets invoked. But, it returns the number of rows _before_ the > addition. If I return from that view controller and then go back into it, > it has the correct number. It's behaving like there's something blocking > the -reloadData operation. > > Perhaps -reloadData is sensitive to where it is called from? My context is > that I have a table of users, the 0th element of which segues modally to a > new VC to add a new user, then returns. Then in the original VC's > -viewWillAppear: I issue the -reloadData. Should I instead do this from > within the "add new user" VC? Or is there some other iOS pattern to do > this? > > -Carl > > > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/diederik%40tenhorses.com > > This email sent to diede...@tenhorses.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com