Мне нужно открыть приложение настроек из моего приложения, если gps не включен в iPhone. Я использовал следующий код. Он отлично работает в симуляторе iOS, но он не работает в iPhone. Могу ли я узнать, есть ли какие-либо проблемы в этом коде.
if (![CLLocationManager locationServicesEnabled]) {
int (*openApp)(CFStringRef, Boolean);
void *hndl = dlopen("/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices");
openApp = (int(*)(CFStringRef, Boolean)) dlsym(hndl, "SBSLaunchApplicationWithIdentifier");
openApp(CFSTR("com.apple.Preferences"), FALSE);
dlclose(hndl);
}