Skip to content

isMenuItemsStale return issue #15

Open
@bkai

Description

@bkai

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions