将 NSData 写入文件?
我正在尝试将 nsdata 写入磁盘上的文件,我有以下代码,但它不起作用,我做错了什么吗?
Boolean result = [data writeToFile:@"/Users/aryaxt/Desktop/test2.avi" atomically:YES];
test2.avi 不存在,我假设 writeToFile 会为我创建它
I am trying to write an nsdata to a file on my disk, I have the following code and it doesn't work, am i doing anything wrong?
Boolean result = [data writeToFile:@"/Users/aryaxt/Desktop/test2.avi" atomically:YES];
test2.avi doesn't exist, I am assuming that writeToFile would create it for me
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用 :
这会告诉您写入失败的原因。
Try using :
That'll tell you why the write is failing.