• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Reading System Preferences
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
References: 
 >Re: Reading System Preferences (From: David Thorup <email@hidden>)

  • Prev by Date: Scrolling Thumbnails (Like Preview)
  • Next by Date: Re: Scrolling Thumbnails (Like Preview)
  • Previous by thread: Re: Reading System Preferences
  • Next by thread: Re: Reading System Preferences
  • Index(es):
    • Date
    • Thread