简体   繁体   中英

iOS7: Multi-UITableview rendering lag

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM