mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-25 04:09:24 +00:00
Added stub for custom attribute dynamic lookup
This commit is contained in:
@@ -8,6 +8,29 @@
|
||||
|
||||
#import "KPKEntry+MPCustomAttributeProperties.h"
|
||||
|
||||
NSString *const MPCustomAttributePropertyPrefix = @"valueForCustomAttribute";
|
||||
|
||||
@implementation KPKEntry (MPCustomAttributeProperties)
|
||||
|
||||
/*- (void)forwardInvocation:(NSInvocation *)anInvocation {
|
||||
NSString *selector = NSStringFromSelector(anInvocation.selector);
|
||||
if([selector hasPrefix:MPCustomAttributePropertyPrefix]) {
|
||||
NSString *key = [selector substringFromIndex:MPCustomAttributePropertyPrefix.length];
|
||||
KPKAttribute *attribute = [self attributeWithKey:key];
|
||||
if(attribute) {
|
||||
anInvocation.selector = @selector(value);
|
||||
[anInvocation invokeWithTarget:attribute];
|
||||
}
|
||||
else {
|
||||
anInvocation.selector = @selector(_unkownCustomAttributeValue);
|
||||
[anInvocation invokeWithTarget:self];
|
||||
}
|
||||
}
|
||||
else [super forwardInvocation:anInvocation];
|
||||
}*/
|
||||
|
||||
- (NSString *)_unkownCustomAttributeValue {
|
||||
return @"";
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user