1

Problem

When a user touches a cell, the app crashes due to an EXC_BAD_ACCESS error.
This has been crashing the app for some time (perhaps since iOS 8, 7 or even 6)

Crash

The crash is occuring inside AQGridView.m
here:

return ( (UIView *)imp(self, @selector(hitTest:withEvent:), point, event) );

return ( (UIView *)imp(self, @selector(hitTest:withEvent:), point, event) );

Appears to on occasion work just fine (unclear why) when switching between testing devices:
[iPhone6, another iPhone6, and an iPhone6+]


Implementation

The AQGridView is set to strong and is referenced in an XIB file

@property (nonatomic, strong) IBOutlet AQGridView *gridView;

The DataSource and Delegate are being set

self.gridView.delegate = self;
self.gridView.dataSource = self;

This used to work, but recently it's been crashing, and inconsistently too...
It's not clear, but I think the problem started around iOS 7 or 8

Attempts

  • Updated to latest AQGridView:: Appeared to temporarily fix it, but the app soon began crashing when touching a cell again...
  • Updated code for working with AFNetworking 2.0 SDK:: (thinking the problem was related to an adjacent networking issue) No fix...
  • Grasping at straws:: Maybe the Cells were not properly being retained (but this is in ARC) so used an array to store them: No Fix...
Community
  • 1
  • 1
Jono Tho'ra
  • 1,476
  • 3
  • 18
  • 28

1 Answers1

4

same Probleme here. In Simulator, all works fine. On Devices (IPad Mini and IPad Air2) my App crashes on same line in code, when tabbing on a cell.

I can fix it, when I change the code inside the _basicHitTest:

  - (UIView *) _basicHitTest: (CGPoint) point withEvent: (UIEvent *) event
{
    return [super hitTest:point withEvent:event];
}

But this couldn't be the best solution to fix it inside foreign code... I will look forward hopefully for a solution here :-) Simone

Simone
  • 41
  • 3
  • That seemed to fix for now! The inline comment does explains how this fix might not work, but interestingly it's fine. Maybe Apple changed up the code so it could work now? – Jono Tho'ra Dec 08 '15 at 18:29