
####Creating Folders on Disk
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ NSFileManager *fileManager = [[NSFileManager alloc] init]; NSString *tempDir = NSTemporaryDirectory(); NSString *imagesDir = [tempDir stringByAppendingPathComponent:@"images"]; NSError *error = nil; if ([fileManager createDirectoryAtPath:imagesDir withIntermediateDirectories:YES attributes:nil error:&error]){ NSLog(@"成功创建目录."); } else { NSLog(@"创建目录失败 Error = %@", error); } self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; return YES; }
|
Reference
近期评论