获取文件路径
- (NSString *)getFilePath
{
         2.获取所要存储的文件路径
           (1)获取Documents文件夹路径
             NSDocumentDirectory 用来获取指定文件夹的路径
             NSUserDomainMask 设置查找的域,我们的自己的文件都是存储在用户域的
             @param yes 是否使用详细路径(绝对路径)
             @return 因为最初该方法是适用于MAC OS的,而对于电脑系统可能有对个用户,所以获取到的路径可能有多条,所以返回值类型是数组,但对于iOS下,就只有一个用户,所以数组中只有一个元素.
        

    NSString * documentsPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject;
           

            (2)拼接上要存储的文件路径.
    NSString * newFilePath = [documentsPath stringByAppendingPathComponent:@"aa.txt"];
    return newFilePath;
}



     1.获取存储的内容.
    NSString * content = self.fileview.TF.text;
    NSString * content1 = self.fileview.TFView.text;
     

    3.将内容存储到指定文件路径
    NSError * error = nil;
    
        (1)字符串写入本地文件
             BOOL isSucceed = [content writeToFile:[self getFilePath] atomically:YES encoding:NSUTF8StringEncoding error:&error];
               NSLog(@"%d",isSucceed);

        (2)数组写入本地文件.
              NSArray * arr = @[content,content1];
               BOOL isSucceed = [arr writeToFile:[self getFilePath] atomically:YES];
               NSLog(@"%d",isSucceed);
    
         (3)字典写入本地文件
                NSDictionary * dic = @{@"tf1": content, @"tf2":content1};
               BOOL isSucceed = [dic writeToFile:[self getFilePath] atomically:YES];
                 NSLog(@"%d",isSucceed);