2

Totally stumped on this. When I dismiss my view controller which is being presented with a custom presentation/transition in iOS 8, I get a crash on private API with this error:

*** Assertion failure in -[UICollectionView dealloc], /SourceCache/UIKit/UIKit-    3318.16.21/UICollectionView.m:665

All I know is if I remove any of these:

[self.collectionView performBatchUpdates:^{
    // append your data model to return a larger size for
    // cell at this index path
} completion:nil];

then it doesn't crash.

But those methods ARE NOT being called on dealloc, dismiss, viewWillDisappear. Literally anything. It's like the invocations or messages are bing stuck in some dimension and called after the view is dismissed. But I can't log them and if I try to put in logic that prevents them being called in that case, it does nothing. Which kinda makes sense: they aren't actually BEING called.

UGH! Ideas?

Update:

I just got a crash with more info (tho still opaque)

malloc: *** mach_vm_map(size=2146844672) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug

Update 2:

I got it to stop crashing by wrapping some code in:

[self performAfterDelay:0 block:^{
    //batch updates
}];
Will Larche
  • 3,119
  • 7
  • 26
  • 34
  • This answer looks like its addressing a similar issue: [mach_vm_map failed (error code=3)](http://stackoverflow.com/a/20976220/35499). Basically it suggests to use instruments to see where you may be leaking memory. – Dean Jan 09 '15 at 20:13
  • Well, I did that. And there aren't any. I did found out how to prevent the crash (but not the cause.) See Update 2. – Will Larche Jan 09 '15 at 21:24

0 Answers0