self->key = [_key copyWithZone:NULL];
self->value = [_value retain];
self->operator = _selector;
+
+ if (_selector == nil) {
+ NSLog(@"WARNING(%s): got no selector for kv qualifier (key=%@)",
+ __PRETTY_FUNCTION__, _key);
+ }
+
return self;
}
+- (id)init {
+ return [self initWithKey:nil operatorSelector:NULL value:nil];
+}
+
- (void)dealloc {
[self->key release];
[self->value release];
self->key = [[_coder decodeObject] copyWithZone:[self zone]];
self->value = [[_coder decodeObject] retain];
[_coder decodeValueOfObjCType:@encode(SEL) at:&(self->operator)];
+
+ if (self->operator == nil) {
+ NSLog(@"WARNING(%s): decoded no selector for kv qualifier (key=%@)",
+ __PRETTY_FUNCTION__, self->key);
+ }
+
return self;
}
}
else if ((s = [_unarchiver decodeObjectForKey:@"selector"]) != nil)
self->operator = NSSelectorFromString(s);
+ else {
+ NSLog(@"WARNING(%s): decoded no selector/selectorName for kv qualifier "
+ @"(key=%@)",
+ __PRETTY_FUNCTION__, self->key);
+ self->operator = EOQualifierOperatorEqual;
+ }
+
+ if (self->operator == nil) {
+ NSLog(@"WARNING(%s): decoded no selector for kv qualifier (key=%@)",
+ __PRETTY_FUNCTION__, self->key);
+ self->operator = EOQualifierOperatorEqual;
+ }
}
return self;
}
- (NSString *)description {
NSMutableString *s;
+ NSString *tmp;
s = [NSMutableString stringWithCapacity:64];
- [s appendString:self->key];
+
+ if (self->key != nil)
+ [s appendString:self->key];
+ else
+ [s appendString:@"[NO KEY]"];
+
[s appendString:@" "];
- [s appendString:[EOQualifier stringForOperatorSelector:self->operator]];
+
+ if ((tmp = [EOQualifier stringForOperatorSelector:self->operator]) != nil)
+ [s appendString:tmp];
+ else if (self->operator != nil)
+ [s appendString:@"[NO STR OPERATOR]"];
+ else
+ [s appendString:@"[NO OPERATOR]"];
+
[s appendString:@" "];
- [s appendString:[self->value qualifierDescription]];
+
+ if ((tmp = [self->value qualifierDescription]) != nil)
+ [s appendString:tmp];
+ else
+ [s appendString:@"nil"];
return s;
}