}
- (BOOL)decodeBoolForKey:(NSString *)_key {
- return [[self->plist objectForKey:_key] boolValue];
+ id v;
+
+ if ((v = [self->plist objectForKey:_key]) == nil)
+ return NO;
+
+ if ([v isKindOfClass:[NSString class]]) {
+ unsigned l = [v length];
+
+ if (l == 4 && [v isEqualToString:@"true"]) return YES;
+ if (l == 5 && [v isEqualToString:@"false"]) return NO;
+ if (l == 3 && [v isEqualToString:@"YES"]) return YES;
+ if (l == 2 && [v isEqualToString:@"NO"]) return NO;
+ if (l == 1 && [v characterAtIndex:0] == '1') return YES;
+ if (l == 1 && [v characterAtIndex:0] == '0') return NO;
+ }
+
+ return [v boolValue];
}
- (int)decodeIntForKey:(NSString *)_key {
return [[self->plist objectForKey:_key] intValue];