我想开发一个应用从设置中读取string。要在越狱设备中,我知道不能放在应用商店。不过还需要实现。
我试过用int或者bool,我实现的代码:
int F1;
bool F2;
读取代码:
F1 = [[[NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.xx.pxx.plist"]valueForKey:@"kF1"]intValue];
F2 = [[[NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.xx.pxx.plist"]objectForKey:@"kF2"]boolValue];
在设置Plist中已经做得修改:
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<true/>
<key>defaults</key>
<string>com.xx.pxx</string>
<key>key</key>
<string>kF1</string>
<key>label</key>
<string>Activate the tool</string>
</dict>