AlanQuatermain / AQGridView

A grid view for iPhone/iPad, designed to look similar to NSCollectionView.
http://quatermain.tumblr.com/
BSD 3-Clause "New" or "Revised" License
2.37k stars 450 forks source link

BUG: EXC_BAD_ACCESS crash in touchesEnded: ( see SpringBoard demo ) #129

Closed spiderr closed 12 years ago

spiderr commented 12 years ago

Run SpringBoard.xcodeproj

Touch and hold any colored rectangle and drag to a new location.

Tap and release on any other rectangle. (Tap and drag other rectangle works.)

BOOM! EXC_BAD_ACCESS right here:

- (void) touchesEnded: (NSSet *) touches withEvent: (UIEvent *) event
{
  [[self class] cancelPreviousPerformRequestsWithTarget: self
                                                 selector: @selector(_gridViewDeferredTouchesBegan:)
                                                   object: nil];

    UIView * hitView = _touchedContentView;

Been hunting this down thinking it was my own code. _touchedContentView is holding on to dealloced memory?

Running XCode 4.3.1 for ARC enabled iOS 5.1 project.

spiderr commented 12 years ago

Anyone...? Bueller?

dolfin commented 12 years ago

I'm having this issue too. Looking forward for a solution.

spiderr commented 12 years ago

This isn't a solution, per se. I spent time trying to sort it out, however I ultimately dropped AQGridView because of this, and migrated to https://github.com/ultragtx/GSBookShelf - seems to work great.

TA2k commented 12 years ago

a workaround is to change in line 116 in AQGridView.h "__unsafe_unretained" to "__strong"

jsumners commented 12 years ago

You don't even have to move a rectangle to introduce the bug. Simply "pick up" a rectangle, "drop" it, and then tap it (like it would open an application).

evadne commented 12 years ago

This is a very bad bug related to the earlier ARC conversion and use of an unsafe and unretained faux “weak” reference. Hopefully we’ll be able to fix it very soon.

On Aug 17, 2012, at 5:46 AM, James Sumners notifications@github.com wrote:

You don't even have to move a rectangle to introduce the bug. Simply "pick up" a rectangle, "drop" it, and then tap it (like it would open an application).


Reply to this email directly or view it on GitHub: https://github.com/AlanQuatermain/AQGridView/issues/129#issuecomment-7816845

evadne commented 12 years ago

This issue should now be partially resolved on the develop branch. (“Crash is gone.”)

I’m seeing artifacts related to drop animation using the wrong rect (cell index off by one) in some edge cases in SpringBoard and zapping the cells prematurely, triggering a recreation process; those issues will be resolved later.

Thanks!

On Aug 17, 2012, at 9:10 AM, Evadne Wu ev@radi.ws wrote:

This is a very bad bug related to the earlier ARC conversion and use of an unsafe and unretained faux “weak” reference. Hopefully we’ll be able to fix it very soon.

On Aug 17, 2012, at 5:46 AM, James Sumners notifications@github.com wrote:

You don't even have to move a rectangle to introduce the bug. Simply "pick up" a rectangle, "drop" it, and then tap it (like it would open an application).


Reply to this email directly or view it on GitHub: https://github.com/AlanQuatermain/AQGridView/issues/129#issuecomment-7816845

evadne commented 12 years ago

Closing issue: tracking SpringBoard progress separately.