Instance Method

removeFromPreferencesWithCompletionHandler:

Removes the DNS proxy configuration from the caller's DNS proxy preferences.

Declaration

- (void)removeFromPreferencesWithCompletionHandler:(void (^)(NSError *error))completionHandler;

Parameters

completionHandler

A block called when the remove operation completes. If the operation fails, an error instance passed to this block describes the problem. Otherwise, the error is nil. See NEDNSProxyManagerError for the list of possible errors.

Discussion

If you use a device without an installed configuration profile during development, your app can create the DNS proxy configuration from scratch. You first call the loadFromPreferencesWithCompletionHandler: method to retrieve the empty configuration. You then make updates and call the saveToPreferencesWithCompletionHandler: method to store them. To remove the configuration, call the removeFromPreferencesWithCompletionHandler: method. This allows you to restore the device to a clean, unconfigured state.

In a production environment, however, a configuration profile placed in the system by an external process typically provides the baseline DNS proxy configuration. Your app can modify this configuration at runtime using the same load-modify-save steps, but cannot remove the configuration entirely. An attempt to remove the configuration when a configuration profile is present on the device results in a NEDNSProxyManagerErrorConfigurationCannotBeRemoved error.

If the DNS proxy is enabled, it becomes disabled as a result of this call.

See Also

Managing the DNS Proxy Configuration

+ sharedManager

Returns a singleton DNS proxy manager instance.

- loadFromPreferencesWithCompletionHandler:

Loads the current DNS proxy configuration from the caller's DNS proxy preferences.

- saveToPreferencesWithCompletionHandler:

Saves the DNS proxy configuration in the caller's DNS proxy preferences.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software