0

I have a viewcontroller in a universal app which has 5 coloumns (UITableview). Initially I fetch data from CoreData and then categorise it in 5 NSArrays. After that I call all 5 UITableViews to reload via following code.

    [[NSOperationQueue mainQueue] addOperationWithBlock:^{
        [_tvLeftMost reloadData];
    }];
    [[NSOperationQueue mainQueue] addOperationWithBlock:^{
        [_tvLeft reloadData];
    }];
    [[NSOperationQueue mainQueue] addOperationWithBlock:^{
        [_tvCenter reloadData];
    }];
    [[NSOperationQueue mainQueue] addOperationWithBlock:^{
        [_tvRight reloadData];
    }];
    [[NSOperationQueue mainQueue] addOperationWithBlock:^{
        [_tvRightMost reloadData];
    }];

on both IOS7&8(iPAD3) the data is fetched in 0.5 secs. But reload tables takes 5 secs on iOS8 and 20+ secs on iOS7. The UITableView's cell are not complex and only involve a local UIImage & a UILabel. How can I decrease rendering time on iOS7?

Abid Hussain
  • 1,529
  • 1
  • 15
  • 33

1 Answers1

0

Try to reload your UITableView in below way -

dispatch_async(dispatch_get_main_queue(), ^{
    [self.tableView reloadData];
});

If your UITableView load image from web url , then it must be async image loading. Please check this tutorial for async image loading.

Community
  • 1
  • 1
Santu C
  • 2,644
  • 2
  • 12
  • 20
  • Tried that too. problem is that there are 5 of them. single table reload is no problem. Also dispatch_async with main queue is kind of same to adding operations on main NSOperationQueue's main queue. – Abid Hussain Jun 10 '15 at 10:00
  • you should keep your code in dispatch_async for load label and image in cellForRowAtIndexPath – Santu C Jun 10 '15 at 10:03