Re: System Config Framework - is this legal?
Re: System Config Framework - is this legal?
- Subject: Re: System Config Framework - is this legal?
- From: Chris Hanson <email@hidden>
- Date: Sun, 17 Nov 2002 14:55:18 -0600
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@hidden
bDistributed.com, Inc. | Phone: +1-847-372-3955
Making Business Distributed | Fax: +1-847-589-3738
http://bdistributed.com/ | Personal Email: email@hidden
_______________________________________________
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.