Tuesday, April 30, 2013

NSURL absoluteURL example ios


absoluteURL

Returns an absolute URL that refers to the same resource as the receiver.
- (NSURL *)absoluteURL
Return Value of [NSURL absoluteURL]
An absolute URL that refers to the same resource as the receiver. If the receiver is already absolute, returns self. Resolution is performed per RFC 1808.
Example of [NSURL absoluteURL]
NSURL * bundle = [[NSBundle mainBundle] bundleURL];
NSURL * file = [NSURL URLWithString:@"../Data/file.txt" relativeToURL:bundle];
NSURL * absoluteFile = [file absoluteURL];
Example of [NSURL absoluteURL]
[[[[request URL] absoluteURL] path] pathExtension];