iPhone应用程序的基本路径 [英] iOS application base path

查看:121
本文介绍了iPhone应用程序的基本路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发使用的PhoneGap /杰基尔/骨干网的应用程序。但是我在需要对我这一代的静态内容的基本路径。针对Android平台我使用 / android_asset / WWW / 这是工作的罚款。不过,我无法找到一个用于iOS系统,任何人有任何想法呢?

I am currently developing an application using Phonegap / Jekyll / Backbone. I am however in the need for a base path for my generation of static content. For Android platforms I use /android_asset/www/ which is working fine. I am however unable to find one for iOS, anyone has any idea about it?

先谢谢了。

推荐答案

您必须异步要求iOS设备给您根路径。在 deviceready 的函数调用:

You have to asynchronously ask the iOS device to give you the root path. In deviceready function call:

window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFS, null);

当准备将与回调的文件系统的对象,从中可以访问完整的根路径。

When ready it will callback with a FileSystem object from which you can access the full root path.

function onFS(fs) {
    alert(fs.root.fullPath); 
}

了解更多关于的PhoneGap /科尔多瓦文档:的http://文档。 phonegap.com/en/edge/cordova_file_file.md.html#FileSystem

这篇关于iPhone应用程序的基本路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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