HttpConnection, UITableView and RunLoops and Loading from Disk
-
25-10-2019 - |
Question
I'm loading images in to a large grid on a table view. They are coming from the net, but once downloaded they are cached to disk.
I use this:
[_httpConnection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
to ensure that they load into view whilst I'm still scrolling. Works fine.
However, when I revisit them and they are loading from disk - I don't have the same scheduleInRunLoop method to use ... well I might, but I don't know where it is.
Has anyone got any ideas?
Thanks
Solution
I found the answer.
I can dispatch my selector using modes:
[self performSelector:@selector(imageReadyToDeliver) withObject:nil afterDelay:0];
I can use
[self performSelector:@selector(imageReadyToDeliver) withObject:nil afterDelay:0 inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow