App crashs on 8.3 while launching the settings App

Hi,

My App Crashes with some Crash logs while launching the Settings app in order for the user to change the Camera usage settings.

When I run this code

BOOL canOpenSettings = (&UIApplicationOpenSettingsURLString != NULL);

if (canOpenSettings) {

NSURL *url = [[NSURL URLWithString:UIApplicationOpenSettingsURLString]autorelease];

[[UIApplication sharedApplication] openURL:url];

The Settings App Launches and irrespective of wheather I change the settings or not the APP Relaunches and as I change the setting there is some part of code which executes sending Crash logs to our server.

I know that when the settings change happen the APP gets SIGKILL and the app relaunches.

But SIGKILL doesnt happen in 8.1 if I DONT change the settings and I can come back to my app and continue with my operations.

How do I ensure that the behaviour of 8.1 is replicated on 8.3. Is there any change in the Settings APP over 8.1 which is causing this issue.

Thanks in Advnace,

Goodfellas team

I think your problem is this line:


NSURL *url = [[NSURL URLWithString:UIApplicationOpenSettingsURLString]autorelease];


URLWithString will return you an autoreleased URL already, but then you are autoreleasing it again. This will over-release the object.


A bigger question here (in all seriousness, I'm not trying to be snide) is why you're not using ARC? At this point in time there's really no reason that you shouldn't be using Automatic Reference Counting. These are exactly the types of crashing bugs that ARC can help prevent. I would strongly encourage you to switch to using ARC for all your code.

Literally wondering the same thing? Its been a long time since we have used any manual reference counted code.

App crashs on 8.3 while launching the settings App
 
 
Q