iphone - Load UITableViewController before webservices -
i trying load data web-services
, insert uitableviewcontroller
.
i can problem is, 'hang' short period @ first uiview before going uitableviewcontroller
, when loading web-services
internet. hang
longer if internet speed slow.
any chance can showing empty uitableviewcontroller
first 'loading' sign , start retrieving data web-services
, reload table?
currently, put function used call web-services
in
- (void)viewdidload { [super viewdidload]; self._completelist = [[nsmutablearray alloc]init]; self._completelist = [self getlistfromwebservices]; }
best approach suggestion have use grand central dispatch (gcd) bellow example
dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{ //code webservices calling dispatch_async(dispatch_get_main_queue(), ^{ //reload tableview here [self.tableview reloaddata]; }); });
Comments
Post a Comment