Thema Datum  Von Nutzer Rating
Antwort
02.01.2012 18:48:02 Denis
NotSolved
02.01.2012 21:06:42 OC
NotSolved
02.01.2012 23:17:33 Denis
NotSolved
Blau lesen aus plist (NSDictionary)
03.01.2012 20:34:55 OC
NotSolved

Ansicht des Beitrags:
Von:
OC
Datum:
03.01.2012 20:34:55
Views:
1580
Rating: Antwort:
  Ja
Thema:
lesen aus plist (NSDictionary)

hilft Dir das weiter? :

- (void)readPlist
{
    NSString *filePath = @"/System/Library/CoreServices/SystemVersion.plist";
        NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];
        
        NSString *value;
        value = [plistDict objectForKey:@"ProductVersion"];
      
        /* You could now call the string "value" from somewhere to return the value of the string in the .plist specified, for the specified key. */
}


- (void)writeToPlist
{
    NSString *filePath = @"/System/Library/CoreServices/SystemVersion.plist";
        NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];
        
        [plistDict setValue:@"1.1.1" forKey:@"ProductVersion"];
        [plistDict writeToFile:filePath atomically: YES];

/* This would change the firmware version in the plist to 1.1.1 by initing the NSDictionary with the plist, then changing the value of the string in the key "ProductVersion" to what you specified */

 

bzw.

// ...
NSDictionary *myDictionary = [[NSDictionary alloc] initWithContentsOfFile:@"filePath"];
NSArray *myArray = [myDictionary valueForKey:@"myArray"];
// ... 

 

Quelle:

http://www.ifans.com/forums/showthread.php?t=64679

 

Habe 2 kleine Kinder die gerade quengeln und deswegen keine Zeit dies besser auszuprobieren, sorry

Viele Grüße

OC


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
02.01.2012 18:48:02 Denis
NotSolved
02.01.2012 21:06:42 OC
NotSolved
02.01.2012 23:17:33 Denis
NotSolved
Blau lesen aus plist (NSDictionary)
03.01.2012 20:34:55 OC
NotSolved