AQGridView icon indicating copy to clipboard operation
AQGridView copied to clipboard

EXC_BAD_ACCESS After XCode Validate Project Settings

Open DenVog opened this issue 9 years ago • 2 comments

I have an older app that I recently opened with XCode 6.3.2. Did a build on a device running iOS 8.3 and it seemed to run fine. XCode pestered me to

Validate Project Settings / Update to recommended settings After doing so, I see a crash when I run on a device: AQGridViewUpdateInfo line 775 NSUInteger newIndex = _oldToNewIndexMap[oldIndex]; gets Thread 1:EXC_BAD_ACCESS (code=1, address=0xfffffffffffffff8) Other than updating to the latest version of AQGridView, I've only made 2 changes:

  1. Changed GUARD_ITEMS so you can build in debug without crashing. https://github.com/AlanQuatermain/AQGridView/issues/208
  2. Workaround for compiler error: too many arguments https://github.com/AlanQuatermain/AQGridView/issues/211

DenVog avatar Jun 06 '15 13:06 DenVog

Did you manage to fix this error ??

Malek-aljundi avatar Sep 26 '16 20:09 Malek-aljundi

We implemented #211 and #208 and hit this problem. During debugging, I saw that (in my case) the app hit line 190: _oldToNewIndexMap == NULL. On line 775 (where the failure occurs), the code is trying to access that variable (even though it's null). Classic. To fix, I added the following to the condition in to for loop: && _oldToNewIndexMap != NULL. This seems to have solved our problems, but we don’t use the library extensively so tread carefully.

To recap, line 773 should now look like this: for ( NSUInteger oldIndex = [movingSet firstIndex]; oldIndex != NSNotFound && _oldToNewIndexMap != NULL; oldIndex = [movingSet indexGreaterThanIndex: oldIndex] )

HeyZiko avatar Dec 05 '16 21:12 HeyZiko