Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // workaround for crash when called the reloadData method during scrolling of a UITableView
- [yourTableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
- // workaround for crash when called the reloadData method during scrolling of a UICollectionView
- [[NSOperationQueue mainQueue] addOperationWithBlock:^{
- [yourCollectionView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
- }];
- // NOTE: remember that you should always cancel the request in dealloc!!
- - (void)dealloc
- {
- [NSObject cancelPreviousPerformRequestsWithTarget:yourTableView];
- [NSObject cancelPreviousPerformRequestsWithTarget:yourCollectionView];
- [super dealloc];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement