promet / PRAugmentedReality

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

ARC Support #2

Closed getaaron closed 11 years ago

getaaron commented 11 years ago

PRAugmentedReality should support ARC. I can work on it together with you if you want.

glesage commented 11 years ago

I've tried converting but it proves unreliable.

Because of the way the AR objects are passed over to the delegate class and never explicitly accessed again, ARC releases them too early...

I might be wrong though but this is what I found during initial tests.

getaaron commented 11 years ago

ARC will deallocate any object that has no strong pointers to it. Anything that you need to keep in scope after the method returns needs to be stored in an instance variable, or in a collection (like NSArray), or passed into a block. If you're doing that and it's getting released early, you probably have a weak reference, not a strong reference to it.

Can you point me to a method in the code where an object is getting released too early?

glesage commented 11 years ago

I'm not too sure... I don't have the files I tried working on anymore, and its proving annoyingly painful to refactor the code with several dependencies and cocoapods.

What led me to believe that "early realeasing" was occurring was the although all the "ar overlays" were being created fine once I tried accessing them on the map or AR view, they simply weren't there anymore /:

I'm going to be real busy because TechWeek Chicago is coming up next week and I'm showcasing this framework with a few test apps, but if anyone has the time to try this out please do (:

Ideally you'd want to import all the dependencies manually and try refactoring the code without cocoapods. It would be easier, I think... I will have a working site soon with test data for everyone to access to test the app with (: https://github.com/promet/PRAugmentedReality/issues/19

Thanks!

glesage commented 11 years ago

Finally done (:

Commit : 8192cfdf1ad42cf2a1bcc2c2e5e2b1e5896dac65