如何使用Objective-C将音频数据保存到CoreData或从CoreData获取音频数据? [英] How do I save and fetch audio data to/from CoreData with Objective-C?

查看:70
本文介绍了如何使用Objective-C将音频数据保存到CoreData或从CoreData获取音频数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iOS开发的新手。

I'm a new to iOS development.

如何保存音频数据和从 CoreData 使用Objective-C?

How can I save and fetch audio data to/from CoreData with Objective-C?

我只知道我必须使用NSData和二进制数据。

I just know that I have to use NSData and Binary Data.

推荐答案

正如@shallowThought在他的评论中所说,您通常不应该在Core Data中存储大型二进制数据对象。将声音文件保存到应用程序的文档目录或其他沙箱目录之一,然后将URL或文件的路径存储在Core Data中。

As @shallowThought says in his comment, you should generally not store big binary data objects in Core Data. Save the sound files to your app's documents directory or one of the other sandbox directories, and then store a URL or path to the file in Core Data.

这篇关于如何使用Objective-C将音频数据保存到CoreData或从CoreData获取音频数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆