Instance Method

setPersistentDomain:forName:

Sets a dictionary for the specified persistent domain.

Declaration

- (void)setPersistentDomain:(NSDictionary<NSString *,id> *)domain forName:(NSString *)domainName;

Parameters

domain

A dictionary of keys and values you want to assign to the domain.

domainName

The name of the domain whose contents you want to set.

Discussion

Calling this method is equivalent to initializing a user defaults object with initWithSuiteName: passing domainName, and calling the setObject:forKey: method for each key-value pair in domain.

When a persistent domain is changed, an NSUserDefaultsDidChangeNotification is posted.

See Also

Maintaining Persistent Domains

- persistentDomainForName:

Returns a dictionary representation of the defaults for the specified domain.

- removePersistentDomainForName:

Removes the contents of the specified persistent domain from the user’s defaults.

- persistentDomainNames

Returns an array of the current persistent domain names.

Deprecated