Search code examples
ioscrashautomatic-ref-countingreleaseretain

Transitioning an Objective C project to ARC and get rid of multiple app crashes


I spent few days working on an app that was built by my friend last year before the release of iOS 8 and Xcode 6+ I believe. He used several libraries like PMCalender , FXforms, MyBlurIntroductionView, CCPickerView, SWRevealTableView etc and I added MBProgressHUD. Now before the app was running without crashes or now as I understand after further studying of the problems I am getting with the app. I believe the app has multiple because of memory leaks. I read his code before modifying it and just noticed there are compile sources he put i.e -fno-objc-arc or fobjc-arc. About a day ago after attempting to integrate SPGooglePlaceAutocomplete for some reason I had to disable Objective-C ARC from Build Settings and then the whole project build with lots of errors. That I had to change weak object to strong in some header file and so forth.

Now I tried to read this for more understanding Apple Transitioning to ARC release NOte

I am posting this question because I'm would say I'm a newbie to iOS development but catching up pretty fast. I need help to have a smooth running app with crashes because. What I am experiencing is not clear to the point that I had to use Instruments to see exactly what is causing the app to crash whereas coming into the app several time at some point it does not crash. When it crashes I get this only thread x and can't really know where to debug

return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));

enter image description here

The add has MapKit and first thing after login screen it should zoom to the user current location. Reason why I used Instruments to see what is happening with the app is because I was suspecting perhaps CoreLocation is causing the crash to connect to the remote CCLocationManager services. As I noticed my phone takes time to turn on gps and it does not always stay on even if I have request location always [self.locationManager requestAlwaysAuthorization];

So I am hoping someone can help me because I did the whole ARC transitioning but still have release, autorelease errors. All my IUOutlet are weak.

Here are the 6 errors I am left with removing with hoping the app will run normal. enter image description here


Solution

  • I this this is the answer to my question, which can be helpful to others after long search and debugging.

    http://www.daveoncode.com/2011/10/24/migration-to-arc-automatic-reference-counting-using-xcode-4-2-refactor/