Skip navigation.
 
mlRe: System Config Framework - is this legal?
FROM : Chris Hanson
DATE : Sun Nov 17 21:55:18 2002

At 10:16 AM +0000 11/15/02, Terence G4 Mac wrote:
>The only truly suspicious thing I can see is :
>
>NSMutableDictionary *devDict = (NSMutableDictionary *)
>            SCPreferencesPathGetValue(prefs, (CFStringRef) devLoc);
>
>Is the return value of SCPreferencesPathGetValue() cast-able to an
>NSMutableDictionary like that? Or should I assign the result to an
>NSDictionary and then do a mutableCopy?


It's not castable like that.  The return value is a CFDictionaryRef,
which is transparently bridged to NSDictionary.

You're exactly right that you need to send it mutableCopy if you want
to modify the returned dictionary.  Then you'll need to use
SCPreferencesPathSetValue to update your key to use your modified
dictionary.  Otherwise, how would the System Configuration framework
know that the information in the dictionary has changed?

By the way, if you're doing System Configuration type things, be sure
to look into MoreSCF in the Apple sample code.  If you're doing any
of a number of standard things with System Configuration (like
creating and managing locations) it will save you tons of time and
frustration.

  -- Chris

--
Chris Hanson                      |  Email: <email_removed>
bDistributed.com, Inc.            |  Phone: +1-847-372-3955
Making Business Distributed      |  Fax:  +1-847-589-3738
http://bdistributed.com/          |  Personal Email: <email_removed>
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlSystem Config Framework - is this legal? Terence G4 Mac Nov 15, 11:16
mlRe: System Config Framework - is this legal? Chris Hanson Nov 17, 21:55