Re: Parsing STDout into an NSDictionary
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