I get a random error that cannot be deterministically recreated, which forces me to debug the pain. The exception is
NSInternalInconsistencyException {Rows: 0x1e5eb080.posErrorMarker == 1 + 1 * 0x1e5eb080.negError + 1 * 0x1fa51a40.marker 0x1f933020.negError == 274 + 1 * 0x1f933020.posErrorMarker + -1 * 0x1fb84100.marker 0x1fb8d610.negError == + 274 -1
> 0CoreFoundation 0x32c1b3e7 + 162 1libobjc.A.dylib 0x3a916963 objc_exception_throw + 30 2CoreFoundation 0x32c1b307 + 106 3Foundation 0x335ce24f + 190 4Foundation 0x335d0871 + 60 5Foundation 0x335d19e9 + 624 6Foundation 0x335d9eab + 230 7UIKit 0x34e6211b + 162 8UIKit 0x34e67b9f + 26 9CoreFoundation 0x32b61acd CFArrayApplyFunction + 176 10UIKit 0x34e67bdf + 90 11CoreFoundation 0x32b61acd CFArrayApplyFunction + 176 12UIKit 0x34e67bdf + 90 13CoreFoundation 0x32b61acd CFArrayApplyFunction + 176 14UIKit 0x34e67bdf + 90 15CoreFoundation 0x32b61acd CFArrayApplyFunction + 176 16UIKit 0x34e67bdf + 90 17UIKit 0x34e67c6f + 26 18UIKit 0x34a2d769 + 732 19UIKit 0x34a78091 + 72 20UIKit 0x34e3b80d + 132 21UIKit 0x34e48e17 + 1830 22UIKit 0x34e46f37 + 7530 23MyApp 0x00093dd1 __32-[MyController requestStuff:]_block_invoke (MyController.m:123) + 298449
MyController.m: 123 is just a call to another method that I defined in MyController.m called requestLocalStuff:
[self requestLocalStuff]
which is strange, because it does not seem to throw an exception on a specific line in requestLocalStuff.
The specific context of what it's called:
- This is returned from the network call. I am using AFNetworking.
- The method that makes the network call accepts the block as a parameter and calls this block after the network call is successfully completed; hence _block_invoke in the stack trace.
- requestLocalStuff makes calls in CoreData and ultimately updates the UICollectionView in the controller using insertItemsAtIndexPaths. But as the stack trace shows, the error does not seem to be thrown from requestLocalStuff
- Due to errors in the UICollectionView, I was forced to subclass the UICollectionViewFlowLayout to catch the exception, the application crashes. Not sure if this could be related.
My subclass of UICollectionViewFlowLayout:
-(void)prepareForCollectionViewUpdates:(NSArray *)updateItems{ @try { [super prepareForCollectionViewUpdates:updateItems]; } @catch (NSException *exception) { DDLogError(@"Error in the layout: %@", exception); } @finally { } }
I searched google for explaining posErrorMarker to no avail. Does anyone know what could happen here?
ios6 core-data uicollectionview objective-c-blocks
haider
source share