NSMutableArray category

Each method in the NSMutableArray category corresponds to a method in the NSMutableArray class, but provides a secure version of the functionality. For more information about the functionality and usage, see NSMutableArray in developer.apple.com.

Note the following:

The url parameter in the category methods must be a file URL, and point to a regular file.

The category methods return an NSError object. The methods set the properties on the object as described in NSError objects that secure Objective-C methods return.

The following table shows each added method and its corresponding method in NSMutableArray.

Table 31.   NSMutableArray category methods

Method in category

Corresponding method in NSMutableArray

+ (id)

arrayWithContentsOfSecureFile:

(NSString *)path

error:(

NSError *__autoreleasing *)error;

+ (id)arrayWithContentsOfFile:

(NSString *)path;

+ (id)

arrayWithContentsOfSecureURL:

(NSURL *)aURL

error:(

NSError *__autoreleasing *)error;

+ (id)arrayWithContentsOfURL:

(NSURL *)aURL;

 

- (id)initWithContentsOfSecureFile:

(NSString *)path

error:(

NSError *__autoreleasing *)error;

- (id)initWithContentsOfFile:

(NSString *)path;

 

- (id)initWithContentsOfSecureURL:

(NSURL *)aURL

error:(

NSError *__autoreleasing *)error;

- (id)initWithContentsOfURL:

(NSURL *)aURL;

 

- (BOOL)writeToSecureFile:

(NSString *)path

atomically:(BOOL)flag

error:(

NSError *__autoreleasing *)error;

- (BOOL)writeToFile:

(NSString *)path

atomically:(BOOL)flag;

 

- (BOOL)writeToSecureURL:

(NSURL *)aURL

atomically:(BOOL)flag

error:(

NSError *__autoreleasing *)error;

- (BOOL)writeToURL:

(NSURL *)aURL

atomically:(BOOL)flag;

 

For a code example, see NSMutableArray category.