Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (android)
Viewing all articles
Browse latest Browse all 7655

Ti.App.properties.setList() doesn't work :S

$
0
0

I'm building an app that has a RSS feed, the feed updates once a day, so of course I only need to update if this is the first time of if the cache is stale. I decided to work with Ti.App.property because it seemed like the obvious way to do this, I have a Data array and it's perfect for that. so I wrote the following code to do that:

if (Ti.App.Properties.hasProperty('tblData')){
    alert('hasProperty:true');
    if (parseInt(Ti.UI.currentWindow.appStartTime)-parseInt(Date.now)>=1){
        getData();
        alert('cache stale');
    }else{
        alert('cache current');
        reloadData();
    }
}
else{
    getData();
    alert('hasProperty:false');
}
and in the "xhr.onload" function I wrote the next line.
Ti.App.Properties.setList('tblData', tblData);
however the next time the window loads I still get the alert('hasProperty:false'); line.

anybody has a clue what's happening to my app's properties?


Viewing all articles
Browse latest Browse all 7655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>