FoundationExtension
FoundationExtension is common Foundation/UIKit/Cocoa shortcuts and snippets collection.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
NSURL(Creations) Category Reference

Creation method extension. More...

#import <NSURL.h>

Instance Methods

Initializing an URL
(instancetype) - initResourceURLWithPath:
 Initializes a newly created NSURL referencing the local file or directory at path based on resource directory of main bundle. More...
 
(instancetype) - initConfigurationURLWithPath:
 Initializes a newly created NSURL referencing the local file or directory at path based on configuration directory. More...
 
(instancetype) - initTemporaryURLWithPath:
 Initializes a newly created NSURL referencing the local file or directory at path based on temporary directory. More...
 
(instancetype) - initSmartURLWithPath:
 Initializes a newly created NSURL referencing any URL decodable by protocol prefix. More...
 

Class Methods

Creating an URL
(instancetype) + resourceURLWithPath:
 Initializes and returns a newly created NSURL object as a file URL with a specified path based on resource directory of main bundle. More...
 
(instancetype) + configurationURLWithPath:
 Initializes and returns a newly created NSURL object as a file URL with a specified path based on configuration directory. More...
 
(instancetype) + temporaryURLWithPath:
 Initializes and returns a newly created NSURL object as a file URL with a specified path based on temporary directory. More...
 
(instancetype) + smartURLWithPath:
 Initializes and returns a newly created NSURL referencing any URL decodable by protocol prefix. More...
 

Deprecated

(id) - initWithAbstractPath:
 
(id) - initWithAbstractFormat:
 
(id) - initWithFormat:
 
(id) - initFileURLWithFormat:
 
(NSURL *) + URLWithAbstractPath:
 
(NSURL *) + URLWithAbstractFormat:
 
(NSURL *) + URLWithFormat:
 
(NSURL *) + fileURLWithFormat:
 

Detailed Description

Creation method extension.

Method Documentation

+ (instancetype) configurationURLWithPath: (NSString *)  path

Initializes and returns a newly created NSURL object as a file URL with a specified path based on configuration directory.

See also
- initConfigurationURLWithPath:
+ (NSURL *) fileURLWithFormat: (NSString *)  format
, (1) 
(2)  __deprecated 
- (instancetype) initConfigurationURLWithPath: (NSString *)  path

Initializes a newly created NSURL referencing the local file or directory at path based on configuration directory.

Parameters
pathThe path that the NSURL object will represent. path should be a valid system path. If path begins with the prefix 'conf://', it will be removed. path should be a relative path from configuration directory
Returns
An NSURL object initialized with path based on configuration directory.
- (id) initFileURLWithFormat: (NSString *)  format
, (1) 
(2)  __deprecated 
- (instancetype) initResourceURLWithPath: (NSString *)  path

Initializes a newly created NSURL referencing the local file or directory at path based on resource directory of main bundle.

Parameters
pathThe path that the NSURL object will represent. path should be a valid system path. If path begins with the prefix 'res://', it will be removed. path should be a relative path from main bundle resource directory.
Returns
An NSURL object initialized with path based on resource directory of main bundle.
- (instancetype) initSmartURLWithPath: (NSString *)  path

Initializes a newly created NSURL referencing any URL decodable by protocol prefix.

Parameters
pathThe path that the NSURL object will represent. path should contains known protocol prefix or be a valid system path. If path begins with the prefix "http://" or "https://", it would be initialized with initWithString:. If path begins with the prefix "res://", it would be initialized with initResourceURLWithPath:. If path begins with the prefix "conf://", it would be initialized with initConfigurationURLWithPath:. Else path should be a valid file system path. It would be initialized with initFileURLWithPath:.
Returns
An NSURL object initialized with path based on protocol prefix.
- (instancetype) initTemporaryURLWithPath: (NSString *)  path

Initializes a newly created NSURL referencing the local file or directory at path based on temporary directory.

Parameters
pathThe path that the NSURL object will represent. path should be a valid system path. If path begins with the prefix 'conf://', it will be removed. path should be a relative path from temporary directory
Returns
An NSURL object initialized with path based on temporary directory.
- (id) initWithAbstractFormat: (NSString *)  format
, (1) 
(2)  __deprecated 
- (id) initWithAbstractPath: (NSString *)  __deprecated
- (id) initWithFormat: (NSString *)  format
, (1) 
(2)  __deprecated 
+ (instancetype) resourceURLWithPath: (NSString *)  path

Initializes and returns a newly created NSURL object as a file URL with a specified path based on resource directory of main bundle.

See also
- initResourceURLWithPath:
+ (instancetype) smartURLWithPath: (NSString *)  path

Initializes and returns a newly created NSURL referencing any URL decodable by protocol prefix.

See also
- initSmartURLWithPath:
+ (instancetype) temporaryURLWithPath: (NSString *)  path

Initializes and returns a newly created NSURL object as a file URL with a specified path based on temporary directory.

See also
- initTemporaryURLWithPath:
+ (NSURL *) URLWithAbstractFormat: (NSString *)  format
, (1) 
(2)  __deprecated 
+ (NSURL *) URLWithAbstractPath: (NSString *)  __deprecated
+ (NSURL *) URLWithFormat: (NSString *)  format
, (1) 
(2)  __deprecated 

The documentation for this category was generated from the following file: