IOS Intro - Write file
#import <sys/xattr.h>
+ (NSString *)getFullFilePathInDocuments:(NSString *)subFilePath fileName:(NSString *)fileName
{
NSString *filePath = [NSString stringWithFormat:@"%@/Documents%@", NSHomeDirectory(), subFilePath];
// NSLog(@"function:%s,getFilePath %@", __FUNCTION__,filePath);
NSFileManager* fm = [NSFileManager defaultManager];
if ([fm fileExistsAtPath:filePath]) {
return [NSString stringWithFormat:@"%@/%@", filePath, fileName];
}
if ([fm createDirectoryAtPath:filePath
withIntermediateDirectories:YES
attributes:nil
error:nil])
{
u_int8_t b = 1;
setxattr([filePath fileSystemRepresentation], "com.apple.MobileBackup", &b, 1, 0, 0);
return [NSString stringWithFormat:@"%@/%@", filePath, fileName];
}
return nil;
}
self.mFile = [MagicEntity getFullFilePathInDocuments:@"/test" fileName:@"yuv.bin"];
NSData *data = [[NSData alloc] initWithBytes:I420 length:w * h * 3 / 2];
bool r = [data writeToFile:self.mFile atomically:true];
IOS Intro - Write file的更多相关文章
- 【ZBar】ios错误ignoring file xxx missing required architecture x86_64 in file
解决方法: 1.在Project target里"Architectures"设置为:Standard (armv7,armv7s)或者 Standard (armv7,arm6 ...
- IOS Intro - Property Synthesis
http://www.thecodecrate.com/ios/objective-c/objective-c-property-synthesize/ 01. atomic ...
- iOS - 文件操作(File Operating)
1. 沙盒 & NSData /*_______________________________获取沙盒路径_________________________________________* ...
- IOS Intro - UIWindow UIView and CALayer
UIWindow.UIView以及CALayer之间的关系2016-05-11 20:46 本站整理 浏览(16) UIWindow1.简介UIWindow是一种特殊的UIView,通常在一个app中 ...
- ios错误ignoring file xxx missing required architecture x86_64 in file
错误ignoring file xxx missing required architecture x86_64 in file 解决方法: 1.在Project target里“Architectu ...
- iOS之input file调用相册控制器消失跳转到登陆页
最近在做一个app要用到H5,其中有一个需求是要点击H5的的控件弹出系统相册,通过在H5的input file 中定义<input type="file" class=&qu ...
- iOS-PCH File的快速导入方法和使用
PCH的文件的用途: 在实际的项目开发中,如果很多地方都在使用某个类的头文件,很多地方都在使用同一个”宏”的时候:很多地方用到了NSLog()函数, 在app发布的时候,想清除掉时,此时就需 ...
- IOS Intro - NSDictionary and NSMutableDictionary
NSDictionary.NSMutableDictionary的基本用法 1.不可变词典NSDictionary 字典初始化 NSNumber *numObj = [NSNumber numberW ...
- react-native IOS Build input file cannot be found: '~~~~~/node_modules/react-native/Libraries/WebSocket/libfishhook.a'
尝试添加或者删除libfishhook.a 如果解决了你的问题请点个赞!
随机推荐
- spark(oom内存溢出异常(out of memory))介绍1
建立如图maven工程 maven的pom文件内容参考别的随笔 参考pom文件内容 同时记得添加scala oom内存溢出异常(out of memory)
- IT技术公众号推荐
获取二维码方法:http://open.weixin.qq.com/qr/code/?username=公众账号,例如:cjscwe_2015 目录 全栈 编程语言 前端开发 移动开发 数据库 操 ...
- Replication--将LSN转换成16进制
在复制中经常会使用到16进制的LSN,但在日志fn_dblog中的LSN是数字形式,于是从网上找到以下转换函数CREATE FUNCTION dbo.fn_convertnumericlsntobin ...
- leetcode 反转字符串
请编写一个函数,其功能是将输入的字符串反转过来. 示例: 输入:s = "hello" 返回:"olleh" /** * @param {string} s * ...
- PageAdmin环境配置要求
1.操作系统要求: Win7/win8/win2008/win2012及以上版本都可以,建议用64位的操作系统,服务器建议选择win2012或以上版本. 2.net framework版本要求: ne ...
- [转]什么是VUE?为什么用VUE?
Vue.js新手入门指南 最近在逛各大网站,论坛,以及像SegmentFault等编程问答社区,发现Vue.js异常火爆,重复性的提问和内容也很多,楼主自己也趁着这个大前端的热潮,着手学习了一段时间的 ...
- 读优&&输优
很nb的技巧……但奇怪的是只能对文件使用…… 然而交到OJ上或者比赛的时候都没有关系→_→ 我大概也只能弄弄这些花里胡哨的东西了→_→ 原理不清楚,背个板子好了 //minamoto #include ...
- LINUX主机通过域名访问网络失败
故障现象: 用telnet IP+端口的方式测试正常,能够访问: 通过telnet域名+端口方式,提示:未知的名称或服务(Name or service not known). 测试百度的网络地址,p ...
- 使用 webpack 搭建 React 项目
简评:相信很多开发者在入门 react 的时候都是使用 create-react-app 或 react-slingshot 这些脚手架来快速创建应用,当有特殊需求,需要修改 eject 出来的 we ...
- PyQt5(4)——菜单栏(使用外部exe)
图像化建立菜单栏: ① 双击输入名称 就可以喽 如何添加工具栏呢: 新建一个快捷工具,拖到快捷栏,出现红色的小竖线. 至此 就完成了菜单栏和快捷方式的建立. 补充: python 如何调用外部的e ...