promet / PRAugmentedReality

iOS Augmented Reality Framework
http://praugmentedreality.com/
MIT License
606 stars 162 forks source link

Dealloc error when switch ViewController #28

Closed fabiomassimo closed 11 years ago

fabiomassimo commented 11 years ago

Hi, I'm trying to use this project with SWReavealViewController. When I try to change view controller the app crashes in [[self delegate] arControllerUpdateFrame:CGRectMake(newPos.origin.x, newPos.origin.y, OVERLAY_VIEW_WIDTH, deviceScreenResolution.height)];

with this debug: Thread 1: EXC_BAD_ACCESS

Is something that i should do before change view controller? If I tried to remove from my view tha arView o the AV layer the app crash in the same way but the error shows on dealloc,

glesage commented 11 years ago

I will look at this first thing in the morning tomorrow (:

glesage commented 11 years ago

Hm, I'm not too familiar with SWRevealVC but I can see a few things which might help you:

  1. First I should say that if it crashes in -refreshPositionOfOverlay function when trying to call the delegate it must be that the delegate is no longer accessible or something of the sort...
  2. Make sure you call [arController stopAR]; whenever the AR view is about to start moving out or sliding or anything. Normally it always gets called before the view is about to disapear but maybe SWRevealVC doesn't call -viewWillDisappear:animated when sliding things and thus stopAR doesn't get called.
  3. I see that SWRevealVC requires ARC so maybe it relies on some of ARC's memory management so that could also be a thing... ARC upgrade is currently being worked on (well at least its in the issue queue)... but if you need it ASAP try and do the upgrade to ARC yourself or message me and I'll see what I can do...

Hope that helps

glesage commented 11 years ago

You might see that I just updated the framework to use ARC so maybe give it a try now (:

fabiomassimo commented 11 years ago

Really great job! Thank you! Now I can use this awesome project even with SWRevealVC (: