I am creating a file in this fashion
Settings = Titanium.Filesystem.getFile(Titanium.Filesystem.tempDirectory,'ProductData'); Ti.API.info("Created Settings: " + Settings.createDirectory()); Ti.API.info('Settings ' + Settings); newFile= Titanium.Filesystem.getFile(Settings.nativePath,'Settings.txt'); newFile.createFile(); if (newFile.exists()){ newFile.write('line 1\n'); Ti.API.info('newfile: '+newFile.read()); }and i have declared var Settings and var newFile in my alloy.js file.
I get an error when i tried accessing the same file in another controller like this
if (newFile.exists()){ Ti.API.info('newfile here : '+newFile.read()); }I am using 3.2.3 GA. What exactly is going wrong here ?since i have decalred these in my alloy.js and it is suppoed to be global