objective-cios8.4

UIApplication is nil within didFinishLaunchingWithOptions


application object passed onto didFinishLaunchingWithOptions is nil when I attach to Process through Xcode6. When ran within the simulator it works fine.

I also tried explicitly getting UIApplication* by

UIApplication* app = [UIApplication sharedApplication];

but this also returns nil. Any idea what I am doing wrong? This started happening after updating the base SDK to iOS8.4.

Thanks.


Solution

  • I found what was causing this issue. I was using 'xcodebuild' command as a workaround to generate an IPA from the archive since I wasn't able to through Xcode6 (because starting Xcode 6 requires Ad Hoc Distribution Provisional Profile to generate an IPA for Ad Hoc Distribution).

    Once I created iOS distribution certificate and Ad Hoc Distribution Provisional Profile. I was able to export an archive to create an IPA through Xcode and no longer had this issue.