Tobonaut Tobonaut - 7 months ago 40
Objective-C Question

"defaults read" as Objective C method

I try to read the plist / xml file which is behind the terminal commando:

defaults read

I tried
without success. Maybe you can help me. Thanks.


You can use CFPreferences, for example

CFStringRef orient = (CFStringRef) CFPreferencesCopyAppValue( CFSTR("orientation"), CFSTR("") );
Boolean hidesIsValid = false;
Boolean hides = CFPreferencesGetAppBooleanValue( CFSTR("autohide"), CFSTR(""), &hidesIsValid );