Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 6    Views: 197

Shakerite
Code is Art
Profile
Posts: 65
Reg: Sep 09, 2011
location unknow...
650
04/14/12 05:21 AM (12 years ago)

RSS Feed Auto-Refresh

Is it possible to have RSS feeds auto-refresh every time it is opened? I noticed that users have to click refresh every time they go into the app to view new articles.
 
AppGuy30
Code is Art
Profile
Posts: 737
Reg: Oct 29, 2011
location unknow...
14,070
like
04/14/12 08:12 AM (12 years ago)
Sure, lets say you wanted to force-refresh the RSS screens. In BT_screens_rssReader.m, find this in the loadData method //look for previously used version... if([BT_fileManager doesLocalFileExist:[self saveAsFileName]]){ [BT_debugger showIt:self:@using cached version of screen data]; NSString *staleData = [BT_fileManager readTextFileFromCacheWithEncoding:self.saveAsFileName:-1]; [self parseScreenData:staleData]; }else{ [self downloadData]; } (NOTE: The forum removes double quotes, you'll see them in the source code) What's happening here is the program is looking for a cached version of the feed from the last time it downoaded it. If it finds it, it's loading up the staleData string variable with the contents then calling parseData. If it doesn't find any chaced (stale) data, it calls downloadData. This just means you can remove all that and call downloadData everytime. Literally remove that section of code and replace it with [self downloadData] You could also comment it out if you don't want to remove it, like this... //look for previously used version... //if([BT_fileManager doesLocalFileExist:[self saveAsFileName]]){ // [BT_debugger showIt:self:@using cached version of screen data]; // NSString *staleData = [BT_fileManager readTextFileFromCacheWithEncoding:self.saveAsFileName:-1]; // [self parseScreenData:staleData]; //}else{ // [self downloadData]; //} [self downloadData] See how were forcing [self downloadData] everytime. This is all inside the loadData method. source: http://www.buzztouch.com/forum/thread.php?tid=35C9CCA460F85572608CF3B&command=isSearching&currentPage=1&topicTitle=auto%20refresh%20v1.5&createdBy=&repliedBy=&minViews=-1&ma
 
shak77
buzztouch Evangelist
Profile
Posts: 399
Reg: Jan 18, 2011
location unknow...
7,240
like
04/14/12 08:22 AM (12 years ago)
Was wondering about this also.
 
Shakerite
Code is Art
Profile
Posts: 65
Reg: Sep 09, 2011
location unknow...
650
like
04/14/12 08:23 AM (12 years ago)
Thanks App Master! I'll try this.
 
XboxMods
buzztouch Evangelist
Profile
Posts: 718
Reg: Oct 28, 2011
location unknow...
12,080
like
04/14/12 08:49 AM (12 years ago)
When I add this: //look for previously used version... if([BT_fileManager doesLocalFileExist:[self saveAsFileName]]){ [BT_debugger showIt:self:@"using cached version of screen data"]; NSString *staleData = [BT_fileManager readTextFileFromCacheWithEncoding:self.saveAsFileName:-1]; [self parseScreenData:staleData]; }else{ [self downloadData]; } Then when I runt the app, It says There was problem saving some data downloaded from the internet.
 
AppGuy30
Code is Art
Profile
Posts: 737
Reg: Oct 29, 2011
location unknow...
14,070
like
04/14/12 08:59 AM (12 years ago)
Dont thank me thank david i just copied this from what he said in another post.
 
AppGuy30
Code is Art
Profile
Posts: 737
Reg: Oct 29, 2011
location unknow...
14,070
like
04/14/12 09:00 AM (12 years ago)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.