Hi there,
I have an NSDictionary as an instance variable, and want to be able to access the values in it by properties (dot syntax).
I am aware you cannot subclass NSDictionary, so I realised I need to create a new class and create properties on it.
So if in my header file I have:
Is there any easy way to intercept this request (i.e. something = myObject.name; or myObject.name = something) before an unrecognised selector is thrown.
My usage of this would typically be:
but without having to create a method for every signature. All help appreciated. Kind regards
Matthew Casey
I have an NSDictionary as an instance variable, and want to be able to access the values in it by properties (dot syntax).
I am aware you cannot subclass NSDictionary, so I realised I need to create a new class and create properties on it.
So if in my header file I have:
Code:
@interface MyTest : NSObject
@property (nonatomic, readonly) NSString *name;
@end
My usage of this would typically be:
Code:
-(NSString *)name {
return [dictionary objectForKey:@"name"];
}
Matthew Casey