TheOS从plist文件中读取

时间:2014-02-09 16:55:55

标签: ios objective-c xcode macos

通过代码禁用/启用调整的最佳方法是什么?另一个问题是:我如何从plist文件中读取值?谢谢 我的代码是:

%hook somethinganother
- (void)somethinghere:(_Bool)arg1
  {
          NSMutableDictionary *settings = [NSMutableDictionary dictionaryWithContentsOfFile:
                            [NSString stringWithFormat:@"%@/Library/Preferences/%@", NSHomeDirectory(), @"com.yourcompany.mytweak.plist"]];
                    if([[settings objectForKey:@"SomethingHere"] boolValue]) {
    %orig(NO);
} else %orig;
 }
  %end

0 个答案:

没有答案