objective c - Refresh UI after downloading data from server in iOS -
i have download few data , display information in colection view. downloading data in loop. want refresh ui after downloading first data server. refreshing ui after downloading data. taking lot of time , user not wait long.as data saved locally refreshing ui this,
[[nsnotificationcenter defaultcenter] postnotificationname:@"refresh" object:self];
the collection view delegates getting called late. how should handle situation.
if method of refreshing content, using nsnotificationcenter
, works, should call on main thread calling in block.
just wrap around current code:
dispatch_async(dispatch_get_main_queue(), ^{ [[nsnotificationcenter defaultcenter] postnotificationname:@"refresh" object:self]; });
Comments
Post a Comment