Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isMenuItemsStale return issue #15

Open
bkai opened this issue May 17, 2013 · 0 comments
Open

isMenuItemsStale return issue #15

bkai opened this issue May 17, 2013 · 0 comments
Assignees

Comments

@bkai
Copy link

bkai commented May 17, 2013

Talking about ch24/iHotelApp/iHotelApp/ directory.

Since fileModificationDate is the date from the past it returns negative value when sent a message timeIntervalSinceNow. Return statement thus evaluates always to NO. I think return fabs(stalenessLevel) > kMenuStaleSeconds; should do the job.

AppCache.m:

+(BOOL) isMenuItemsStale
{
...  
    NSString *archivePath = [[AppCache cacheDirectory] stringByAppendingPathComponent:@"MenuItems.archive"];  

  NSTimeInterval stalenessLevel = [[[[NSFileManager defaultManager] attributesOfItemAtPath:archivePath error:nil] fileModificationDate] timeIntervalSinceNow];

  return stalenessLevel > kMenuStaleSeconds;
}
@end
@ghost ghost assigned MugunthKumar May 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants