Question

I was wondering how i can build an app that reads text / strings from settings . Yes this is only for jailbroken devices . And yes i know i cant put it to the appstore .

I already know how to do it with int or bool but i dont have any idea for string , please help me ! Here is the code :

int F1;
bool F2;

This is how it reads it :

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];

EDIT1: And how or what do i have to change in the settings 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>
Was it helpful?

Solution

For strings:

NSString *string = [[NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.xx.pxx.plist"]objectForKey:@"kF2"];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top