Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

youngplayer

macrumors member
Original poster
May 16, 2008
36
0
Shanghai,China
I'm going to change the network's settings by my codes. I've read the sample code of MoreSCF. and I've set my user as root. and the SCPreferencesPathSetValue returns 'true'! But it doesn't modify the data file, for it doesn't modified when I check the value by "System Preferences".

some of my codes:
SCPreferencesRef gPrefsRef = SCPreferencesCreate(NULL,CFSTR("MyApp"),NULL);

SCPreferencesLock(gPrefsRef,true);

// format path; eg. "/sets/<setID>/Network/Service/<serviceID>"

CFMutableDictionary propertyList = SCPreferencesPahtGetValue(gPrefsRef,path);

// change propertyList

SCPreferencesPathSetValue(gPrefsRef,path,propertyList/*modified*/);

SCPreferencesCommitChanges(gPrefsRef);

SCPreferencesApplyChanges(gPrefsRef);

SCPreferencesUnlock(gPrefsRef);
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.