Skip to content

Commit

Permalink
- isOfflineCacheEnabled was not used anymore, so removed
Browse files Browse the repository at this point in the history
  • Loading branch information
icanzilb committed Mar 26, 2013
1 parent 42f835f commit e3f3d63
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion JSONModelDemo_iOS/KivaViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ -(void)viewDidAppear:(BOOL)animated
self.title = @"Kiva.org latest loans";
[HUD showUIBlockingIndicatorWithText:@"Fetching JSON"];

[JSONCache sharedCache].isOfflineCacheEnabled = YES;
[JSONCache sharedCache].expirationTimeInHours = 10;
[JSONCache sharedCache].expirationTimeInHoursWhenOffline = 10;
[JSONCache sharedCache].revalidateCacheFromServerAfterTimeInHours = 0;
Expand Down
11 changes: 7 additions & 4 deletions JSONModelDemo_iOS/MasterViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ -(void)viewDidAppear:(BOOL)animated

[JSONCache sharedCache].expirationTimeInHours = kImmediatelyExpire;
[JSONCache sharedCache].expirationTimeInHoursWhenOffline = kNeverExpire;
[JSONCache sharedCache].revalidateCacheViaETagAfterTimeInHours = 0;
[JSONHTTPClient setIsUsingJSONCache: YES];
NSLog(@"cache: %@", [JSONCache sharedCache]);
[JSONCache sharedCache].revalidateCacheViaETagAfterTimeInHours = kAlwaysRevalidate;
[JSONCache sharedCache].revalidateCacheFromServerAfterTimeInHours = kAlwaysRevalidate;

[[JSONCache sharedCache] loadCacheFromDisc];

NSLog(@"cache: %@", [JSONCache sharedCache]);

[JSONHTTPClient setIsUsingJSONCache: YES];

self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks target:self action:@selector(actionLoadCall:)];
}
Expand All @@ -44,7 +47,7 @@ -(IBAction)actionLoadCall:(id)sender
[JSONHTTPClient getJSONFromURLWithString:@"http://localhost/testapi/test.php"
completion:^(NSDictionary *json, JSONModelError *err) {

NSLog(@"GOT: %@", json);
NSLog(@"GOT: %@", [json allKeys]);

}];
}
Expand Down

0 comments on commit e3f3d63

Please sign in to comment.