I'm not inventing the wheel. In iOS8, to open Settings from inside the app I'm using this code:
BOOL canOpenSettings = (&UIApplicationOpenSettingsURLString != NULL);
if (canOpenSettings)
{
NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
[[UIApplication sharedApplication] openURL:url];
}
The code is in a lot of answers and questions in stackoverflow.
The problem came out with Xcode 6.3, I've got a warning saying:
Comparison of address of 'UIApplicationOpenSettingsURLString' not equal to a null pointer is always true
What is interesting is that Apple is using it in their example code:
https://developer.apple.com/library/ios/samplecode/AppPrefs/Listings/RootViewController_m.html
Some idea about how to avoid the warning and still checking if I can open Settings?