Am I doing something wrong or there is a problem with the system?
Very simple demo: https://github.com/IgorTavcar/UICollectionViewBug.
Here is a collection view and a periodic trigger, started by
- (void)viewDidAppear:(BOOL)animated {
self.timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(tick) userInfo:nil repeats:TRUE];
}
Every tick
invokes the roladData
of collection view.
- (void)tick {
[self.collectionView reloadData];
}
If scroll view
@property(nonatomic) BOOL bounces
is TRUE
then application crashes with EXC_BAD_ACCESS
after max. 15 seconds of intensive scrolling /bouncing/.
Any suggestions?
I've also tried to do the
dispatch_async(dispatch_get_main_queue(), ^{
self.timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(tick) userInfo:nil repeats:TRUE];
});
and
self.timer = [NSTimer timerWithTimeInterval:0.5 target:self selector:@selector(tick) userInfo:nil repeats:TRUE];
[[NSRunLoop currentRunLoop] addTimer:_timer forMode:NSRunLoopCommonModes];
...