摘要:
创建与删除: //创建文件管理器 NSFileManager *fileManager = [NSFileManager defaultManager]; //获取路径 //参数NSDocumentDirectory要获取那种路径 NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0];//去处需要的路径 //更改到待操作的目录下 [fileMan 阅读全文
摘要:
NSUserDefaults读取和写入自定义对象 NSUserDefaults可以存取一些短小的信息。比如存入再读出一个字符串到NSUserDefaults: view plaincopy to clipboardprint?NSString *string = [NSString stringWithString @"hahaha"]; NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; [ud setObject:string forKey:@"myKey"]; NSString * 阅读全文