iOS - 文件读取

来源:互联网 发布:js点击按钮弹出输入框 编辑:程序博客网 时间:2024/06/15 14:14

// 生成路径          

  NSString  *thepath = [[NSBundle mainBundle] pathForResource:@"xxx" ofType:@"json"];

// 根据路径读取文件内容

  NSString *content = [NSString stringWithContentsOfFile:thepath encoding:NSUTF8StringEncoding error:nil];



0 0
原创粉丝点击