o Offline database cache may have different capacity values for iPhone and iPad
Showing
1 changed file
with
5 additions
and
2 deletions
@@ -190,6 +190,9 @@ | @@ -190,6 +190,9 @@ | ||
190 | NSUInteger minimalPurge = capacity / 10; | 190 | NSUInteger minimalPurge = capacity / 10; |
191 | 191 | ||
192 | NSNumber *capacityNumber = [cfg objectForKey:@"capacity"]; | 192 | NSNumber *capacityNumber = [cfg objectForKey:@"capacity"]; |
193 | + if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad && [cfg objectForKey:@"capacity-ipad"]) | ||
194 | + capacityNumber = [cfg objectForKey:@"capacity-ipad"]; | ||
195 | + | ||
193 | if (capacityNumber != nil) { | 196 | if (capacityNumber != nil) { |
194 | NSInteger value = [capacityNumber intValue]; | 197 | NSInteger value = [capacityNumber intValue]; |
195 | 198 | ||
@@ -214,9 +217,9 @@ | @@ -214,9 +217,9 @@ | ||
214 | NSNumber *minimalPurgeNumber = [cfg objectForKey:@"minimalPurge"]; | 217 | NSNumber *minimalPurgeNumber = [cfg objectForKey:@"minimalPurge"]; |
215 | if (minimalPurgeNumber != nil && capacity != 0) { | 218 | if (minimalPurgeNumber != nil && capacity != 0) { |
216 | NSUInteger value = [minimalPurgeNumber unsignedIntValue]; | 219 | NSUInteger value = [minimalPurgeNumber unsignedIntValue]; |
217 | - if (value > 0 && value<=capacity) | 220 | + if (value > 0 && value<=capacity) { |
218 | minimalPurge = value; | 221 | minimalPurge = value; |
219 | - else { | 222 | + } else { |
220 | RMLog(@"minimalPurge must be at least one and at most the cache capacity"); | 223 | RMLog(@"minimalPurge must be at least one and at most the cache capacity"); |
221 | } | 224 | } |
222 | } | 225 | } |
-
Please register or login to post a comment