- (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]]; }
时间: 2024-12-05 20:53:14