Storing preferenses
Storing preferenses
- Subject: Storing preferenses
- From: Eivind Andersen <email@hidden>
- Date: Mon, 6 Oct 2003 23:56:32 +0200
Hi!
I4m making a Instant Messaging application, where I would like to store
the my own name, the server address and a list containing all the
"buddies", so I don4t have to type them in every time I start the
application
I4m using a NSMutableDictionary, and add the objects that I wish to
save, using the setObject:forKey: method. After that I write the
dictionary to file using: [prefs
writeToFile:[@"~/Library/Preferences/My Client.plist"
stringByExpandingTildeInPath]
atomically: TRUE];
In awakeFormNib i read from this file by using: prefs = [NSDictionary
dictionaryWithContentsOfFile:
[@"~/Library/Preferences/My Client.plist"
stringByExpandingTildeInPath]];
...and take out the various objects with [prefs objectForKey:@"key"]
When I try to extract the buddylist, I use [[[prefs
objectForKey:@"Buddies"]mutableCopy]retain]
but the result is an emtpy array! The array isn4t empty when I (try to)
write it to file!
What am I doing wrong? Can I store and extract an NSMutableArray in
this way?
Best regards,
Eivind Andersen
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.