0
我正在使用UIWebView应用程序,并从JavaScript代码中的服务器获取一些信息。我希望将JSON文本写入文档目录中的文件。我的JavaScript文件的开头部分是:UIWebView写入磁盘方法
WW.FS = {
init: function(animation, back, fn) {
var me = window.ww ? ww.fs : null;
if (me != null) {
PL.tellNative('pl:closeMore');
}
if (!me || !back) {
Ext.Ajax.request({
url: WW.getBS(),
method: 'POST',
params: {ajax: true, source: 'Touch', ID: 'INT'},
success: function(response) {
try {
data = JSON.parse(response.responseText); <--- want to write this to the documents directory!!
} catch(e) {
PL.indicatorOff();
return false;
}
我需要以某种方式得到变量“数据”回无论是从我把它叫做JavaScript文件.m文件或将其写入文件的目录,以便我能稍后阅读。有谁知道如何将变量写入磁盘?我一直在寻找一种方法将数据传输到文档目录中,但没有用处。任何帮助将不胜感激。
也许这可以帮助你[链接](http://mobdevelopment.wordpress.com/2012/07/28/how-to-call-an-objective-c-method-from-javascript/)! – Scar 2013-02-13 17:44:37