开发者

activity indicator in tabbar app

I have a TabBar app that displays a a uitableview on startup. The tableview data is accessed by a file that is stored in the documents directory of the app. The data file is quiet big (60MB). For the first time and only in certain devices (3G) it takes to开发者_开发知识库o long to write to the directory and iOS kills the app.

I would like to add an activity indicator while writing this file to the directory but have no clue where I should put it. Should I load a view controller at start up and then dismiss it when the writing of the file is done? Also, I have no clue how to load this controller and then dismiss it and load my actual tableview. Any suggestions?


dispatch the work into the background

dispatch_queue_t background_queue = dispatch_queue_create("com.your.rdns.notation", NULL);
dispatch_async(background_queue, ^ {
  //do your work here...

  dispatch_async(dispatch_get_main_queue(), ^ {
    //notify the ui here, when your task is done...
  });
});

Also there are quite a few good WWDC sessions WWDC10 - definitely worth a look!

cheers

Ron

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜