Deprecated NSUserDefaults Methods

A method identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in iOS 7.0

initWithUser:

Returns an NSUserDefaults object initialized with the defaults for the specified user account. (Deprecated in iOS 7.0. This method was never implemented to return anything but the defaults for the current user. Use standardUserDefaults instead.)

- (id)initWithUser:(NSString *)username
Parameters
username

The name of the user account.

Return Value

An initialized NSUserDefaults object whose argument and registration domains are already set up. If the current user does not have access to the specified user account, this method returns nil.

Discussion

This method does not put anything in the search list. Invoke it only if you’ve allocated your own NSUserDefaults instance instead of using the shared one.

You do not normally use this method to initialize an instance of NSUserDefaults. Applications used by a superuser might use this method to update the defaults databases for a number of users. The user who started the application must have appropriate access (read, write, or both) to the defaults database of the new user, or this method returns nil.

Special Considerations

This method was never implemented to do anything except return the defaults for the current user.

Availability
  • Available in iOS 2.0 and later.
  • Deprecated in iOS 7.0.
Declared In
NSUserDefaults.h

persistentDomainNames

Returns an array of the current persistent domain names. (Deprecated in iOS 7.0. Instead of using this method, you should track the domains you add if you want to later retrieve them with persistentDomainForName:.)

- (NSArray *)persistentDomainNames
Return Value

An array of NSString objects containing the domain names.

Discussion

You can get the keys and values for each domain by passing the returned domain names to the persistentDomainForName: method.

Availability
  • Available in iOS 2.0 and later.
  • Deprecated in iOS 7.0.
Declared In
NSUserDefaults.h