Skip to content

Instantly share code, notes, and snippets.

@jontelang
Created June 5, 2013 01:34
Show Gist options
  • Save jontelang/5711037 to your computer and use it in GitHub Desktop.
Save jontelang/5711037 to your computer and use it in GitHub Desktop.
asd
static void LoadSettings()
{
NSMutableDictionary *prefs = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.jontelang.ncenoughprefs.plist"];
if(prefs){
isEnabled = [[prefs valueForKey:@"isEnabled"] boolValue];
}
}
%ctor {
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (void *)LoadSettings, CFSTR("com.jontelang.ncenoughprefs/settingschanged"), NULL, CFNotificationSuspensionBehaviorCoalesce);
LoadSettings();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment