You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Talking about ch24/iHotelApp/iHotelApp/ directory.
What is the reason for declaring, that if data is in memory cache, it is not stale? As in AppCache.m:
+(BOOL) isMenuItemsStale
{
// if it is in memory cache, it is not stale
if([recentlyAccessedKeys containsObject:@"MenuItems.archive"])
return NO;
...
}
Below I have extracted all code excerpts to visualize at least two unclear points with this declaration, each of which, when confirmed, would invalidate it.
Point 1:
Data can be in the memory long enough (i.e. longer than kMenuStaleSeconds) to get stale.
Point 2:
Prior to call [AppCache isMenuItemsStale] in the view controller viewWillApear method there is a call to [AppCache getCachedMenuItems] which inserts the data into memory cache and also into recentlyAccessedKeys in case it was not there. Call to [AppCache isMenuItemsStale] thus returns NO in all cases.
Talking about ch24/iHotelApp/iHotelApp/ directory.
What is the reason for declaring, that if data is in memory cache, it is not stale? As in AppCache.m:
Below I have extracted all code excerpts to visualize at least two unclear points with this declaration, each of which, when confirmed, would invalidate it.
Point 1:
Data can be in the memory long enough (i.e. longer than kMenuStaleSeconds) to get stale.
Point 2:
Prior to call [AppCache isMenuItemsStale] in the view controller viewWillApear method there is a call to [AppCache getCachedMenuItems] which inserts the data into memory cache and also into recentlyAccessedKeys in case it was not there. Call to [AppCache isMenuItemsStale] thus returns NO in all cases.
I think the whole
if
statement should be removed.Thanks!
iHotellAppMenuViewController.m:
AppCache.m:
The text was updated successfully, but these errors were encountered: