how-to change network set programmatically

Hello

I am trying to switch between my predefined network sets (Apple Menu -> Location).. for that, several functions have to be used:


  • SCPreferencesLock(prefs, true)
  • SCNetworkSetSetCurrent(set)
  • SCPreferencesCommitChanges(prefs)


Currently my app is sandboxed... this apparently prevents the dialog-box appearing when SCPreferencesLock is called for obtaining the permission (root required for changing set), I get an error-code 1003.

I am struggling now finding the correct entitlements/capabilities in Xcode to get this working....


Can anybody help me out?


thx,

Domenico