Re: Reading System Preferences
Re: Reading System Preferences
- Subject: Re: Reading System Preferences
- From: Seth Willits <email@hidden>
- Date: Sat, 9 Aug 2003 13:46:12 -0700
The WWWHomePage key is not in a place that will be read using the
command you provided. The WWWHomePage is located in:
com.apple.interenetconfig->Version 2.5.4->ic-added->WWWHomePage
Each key in the path above returns a dictionary. So in order to get
the WWWHomePage key you'd need to do something like this....
That worked except that I had to change 2.5.4 to the version I had
which was 2.5.3. How do I account for this version thing? Seems to me
that since "Version x.x.x" is the only object in the root of plist that
I should be able just to grab that one object by index or something but
it looks like I have to use an Enumerator to get the key like this:
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
NSDictionary* dict; // the WWWHomePage key returns a dictionary
NSString* homePage;
dict = [defaults
persistentDomainForName:@"com.apple.internetconfig"];
NSString * versionKey = [[dict keyEnumerator] nextObject];
homePage = [[[[dict
objectForKey:versionKey]
objectForKey:@"ic-added"]
objectForKey:@"WWWHomePage"]
objectForKey:@"ic-data"];
Seth Willits
------------------------------------------------------------------------
---
President and Head Developer of Freak Software -
http://www.freaksw.com
Q&A Columnist for REALbasic Developer Magazine -
http://www.rbdeveloper.com
Webmaster for REALbasic Game Central -
http://www.freaksw.com/rbgames
"Men are like a deck of cards. You'll find the occasional king, but
most are jacks."
-- Laura Swenson
------------------------------------------------------------------------
---
_______________________________________________
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.