2

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];

...

orthodog
  • 71
  • 2
  • Please enable NSZombies and see if a specific instance has been released. Could be an Apple bug, in which case you should open a bug report (despite any workaround you may find). – Léo Natan Sep 26 '13 at 20:31
  • NSZombies spotted: `*** -[NSIndexPath section]: message sent to deallocated instance 0x17d8c3a0` deep inside `-[UICollectionView _unhighlightAllItems]` – orthodog Sep 27 '13 at 07:51
  • Likely an Apple bug due to some race condition. Open bug report at https://bugreport.apple.com and add a sample project for them to see, as well as the `bt` and the "deallocated instance" message. – Léo Natan Sep 27 '13 at 08:20
  • Bug reported to Apple: ticket-id 15095954 – orthodog Sep 27 '13 at 08:24
  • If you are lucky, they will fix it in iOS8.0 :) I still have serious bugs open from the early days of iOS7 betas. – Léo Natan Sep 27 '13 at 08:40
  • Have you found a solution to this? I have the same problem.. – Rameez Hussain Dec 08 '13 at 12:05

1 Answers1

0

Fixed:

https://github.com/IgorTavcar/UICollectionViewBug/issues/1

Uncheck "User Interaction Enabled" and "Multiple Touch" from the Collection View Cell in the Story Board.

Use a gesture recognizer to handle it input instead.

Shane
  • 836
  • 6
  • 3