TableView reloaddata after UI shows up


hi,

have tabbar app second tab has tableviewcontroller.
when on first tab select second tab tableview shows , data loaded.

problem is, data network , takes 2-3 seconds load. until data loaded ui of tableview not showen until data loaded.

how can show second tab no data in tableview , reload table data?

i've tried use -viewwillappear , -viewdidappear ui not showen until both finish.

i've tried

code:
- (void)viewwillappear:(bool)animated { 	 	dataarray = [[nsarray alloc] initwithobjects:@"", nil]; 	 	[self.tableview reloaddata];  	[super viewwillappear:animated];  }    - (void)viewdidappear:(bool)animated { 	         [self loaddata]; //this load actual data dataarray 	[self.tableview reloaddata]; 	           [super viewdidappear:animated];  }

teo
 

how loading data? based on statements, sounds doing synchronously , overloading methods give responsiveness ui. if doing asynchronously, can make call , let delegate callbacks update table when data loaded.

how do loaddata? using nsurlconnection? trying use nsarray:: + (id)arraywithcontentsofurl:(nsurl *)aurl?
 


Forums iPhone, iPad, and iPod Touch iOS Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments