Graphics Programs Reference
In-Depth Information
For BNRFeedStore to make that choice, it needs to know when the RSSChannel was
last cached. In BNRFeedStore.h , add a new property.
@property (nonatomic, strong) NSDate *topSongsCacheDate;
We need this date to persist between runs of the application, so it needs to be stored on the
filesystem. Since this is just a little bit of data, we won't create a separate file for it. In-
stead, we'll just put it in NSUserDefaults .
To do this, you have to write your own implementations of topSongsCacheDate 's ac-
cessor methods instead of synthesizing the property. In BNRFeedStore.m , implement
the accessor methods to access the preferences file.
- (void)setTopSongsCacheDate:(NSDate *)topSongsCacheDate
{
[[NSUserDefaults standardUserDefaults] setObject:topSongsCacheDate
forKey:@"topSongsCacheDate"];
}
- (NSDate *)topSongsCacheDate
{
Search WWH ::




Custom Search