Created
February 20, 2012 12:51
-
-
Save jooddang/1869069 to your computer and use it in GitHub Desktop.
getting NSURL from NSString
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); | |
NSString *cachePath = [paths objectAtIndex:0]; | |
NSString *chunkDirectory = [[NSString alloc] initWithFormat:@"%@/CHUNK/dd", cachePath]; | |
NSURL *url = [NSURL fileURLWithPath:chunkDirectory]; | |
//url = file://localhost/Users/jooddang/Library/Application%20Support/iPhone%20Simulator/5.0/Applications/67AE-MY-IPHONE-ID-ABC87EC/Library/Caches/CHUNK/dd | |
[[NSFileManager defaultManager] fileExistsAtPath:chunkDirectory]; // returns 1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment