- (NSString *)cacheDir { // 1.获取cache目录 NSString *dir = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject]; return [dir stringByAppendingPathComponent:[self lastPathComponent]]; } - (NSString *)documentDir { NSString *dir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; return [dir stringByAppendingPathComponent:[self lastPathComponent]]; } - (NSString *)tmpDir { NSString *dir = NSTemporaryDirectory(); return [dir stringByAppendingPathComponent:[self lastPathComponent]]; }