NSString *lastComponent =
[cachePath
lastPathComponent];
NSString *pathLessFilename = [cachePath
stringByDeletingLastPathComponent];
NSString *originalPath = [pathLessFilename stringByAppendingPathComponent:
lastComponent];
NSString *pathExtension = [[cachePath pathExtension]
lowercaseString];
NSLog(@"%@",
lastComponent);
NSLog(@"%@", pathLessFilename);
NSLog(@"%@", originalPath);
NSLog(@"%@", pathExtension);
原文:http://www.cnblogs.com/zhangyuqing/p/3784307.html