• 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: Parsing STDout into an NSDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing STDout into an NSDictionary


  • Subject: Re: Parsing STDout into an NSDictionary
  • From: Nick Forge <email@hidden>
  • Date: Mon, 26 Feb 2007 12:45:49 +1100

After some more research I discovered that the settings can also be found in /Library/Preferences/SystemConfiguration/ com.apple.PowerManagement.plist, so I can directly import the dictionary and I don't have to worry about parsing. That simplifies things somewhat!


On 25/02/2007, at 10:23 PM, Philip Q wrote:

On 25/02/07, Nick Forge <email@hidden> wrote:
Is there any easy way to use an existing class to parse a whitespace
and newline delimited string into an NSDictionary? I'm really just
being lazy, as I'm quite experienced with C and I can easily write a
parsing loop to deal with it, but I just thought I'd check if there's
an easier way to do it in Cocoa.


Take a look at NSScanner, it's *very* useful for parsing arbitrarily formatted text. It won't get it straight into an NSDictionary, but it'll take all of the hard work out of it.

-Phil

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Parsing STDout into an NSDictionary (From: Nick Forge <email@hidden>)
 >Re: Parsing STDout into an NSDictionary (From: "Philip Q" <email@hidden>)

  • Prev by Date: Re: Implications of changing an app's bundle identifier
  • Next by Date: Re: How to track all window creation?
  • Previous by thread: Re: Parsing STDout into an NSDictionary
  • Next by thread: Re: Parsing STDout into an NSDictionary
  • Index(es):
    • Date
    • Thread