It takes a long time to view the table to update after "reloadData ()"

This is what I am trying to do: Get xml from Apple RSS containing application information, parse it and show the applications as UITable.

The problem is that after "reloadData ()" it takes about 5 seconds until the information appears. In addition, the application always crashes on its first launch after opening a project.

here is the project: http://www.mediafire.com/?2dn6g916bh9uf4v

+5
source share
2 answers

(.. ) , , ( NSOperationQueue NSOperation ) , . ( ) , UITabvleView reloadData.

: :

  • ( "[table reloadData]" ) . , .

  • "" [self loadImages] , "" cellForRowAtIndexPath.

EDIT: , : ( NSLog, 2 performSelectorOnMainThread cellForRowAtIndexPath).

//[table reloadData];
NSLog( @"thread: calling reload" );
[table performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:YES];
//[self loadImages];

, , . : , , [reload Table] (, !). UIKit . , , .

+20

. , :

  NSOperationQueue.mainQueue().addOperationWithBlock(){
  //Perform action on main thread
    tableView.reloadData();
  }
+1

All Articles