For the URL, use the NSURL method:
- (NSURL *)standardizedURL
Returns a new URL pointing to the same resource as the original URL, and is an absolute path.
Example:
NSString *s = @"www.example.com/themes/themeA/../common/assetA.png"; NSURL *u = [NSURL URLWithString:s]; NSURL *su = [u standardizedURL]; NSLog(@"su: %@", su);
NSLog Output:
su: www.example.com/themes/common/assetA.png
source share