Store data's in Ipad
Dear Friends,
iam creating an IOS app using Air for IOS. i want to store data in txt file and retrieve it. Iam using the following code:
import flash.filesystem.*;
import flash.events.MouseEvent;
var cacheDir: File = null;
var tempDir: File = null;
//Initialize the Objects with proper paths.
var str: String = File.applicationDirectory.nativePath;
cacheDir = new File(str + "//Library/Caches");
tempDir = new File(str + "//tmp");
var fr: FileStream = new FileStream();
fr.open(cacheDir.resolvePath("myCache.txt"), FileMode.WRITE);
fr.writeUTFBytes("works");
fr.close();
btn.addEventListener(MouseEvent.CLICK, btn_click)
function btn_click(event: MouseEvent) {
var fw: FileStream = new FileStream();
fw.open(cacheDir.resolvePath("myCache.txt"), FileMode.READ);
txt.text = fw.readUTFBytes(4);
fw.close();
}
it works fine in my desktop. when i compile and intall in ipad, it is not workign pls help me what should i do to make it work. i want to store data's in Ipad..
Thanks in Advance,
Syed Abdul Rahim
