iPhone:如何下载媒体文件并将其保存在设备上 [英] iPhone: how to download media files and save them on device

查看:97
本文介绍了iPhone:如何下载媒体文件并将其保存在设备上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iOs世界的新手,我需要帮助才能在我的应用程序中实现小功能。

I am new in the iOs world and I need help to implement small feature in my application.

我的问题是如何下载媒体文件(即mp4)和将它们保存在设备上供以后使用?当然,保存文件的地方只能从我的应用程序访问(类似于Android中的Context.getCacheDir())。

My question is how to download media files (i.e. mp4) and save them on the device for later use? off course the place that the files will be saved should be accessible from my app only (something similar to Context.getCacheDir() in Android).

谢谢
-Z

thanks -Z

推荐答案

使用缓存目录。例如,您可以通过调用此代码找到它:

Use your cache dir. For instance, you can find it by calling this code:

NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);

这篇关于iPhone:如何下载媒体文件并将其保存在设备上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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