首页 > 代码库 > ios 获取文件扩展名备忘

ios 获取文件扩展名备忘

            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);