I have an implementation which contains a set of methods which do pretty much the same:
- (NSString *) specialKey{
[self.mySpecialDictionary valueForKey:@"specialKey"];
}
- (NSString *) anotherKey{
[self.mySpecialDictionary valueForKey:@"mySpecialKey1"];
}
I can now conveniently use those getters like so:
NSString *foo = [Setting sharedInstance].specialKey;
I guess I should now be able to define my Properties dynamic and make one implementation for all those cases, since the string which I look up in my dictionary will always be the name of the getter. I am pretty sure that this should be do-able in Objective-C, but I have no Idea how to achieve this.
The answer is in your question. Try method forwarding:
Of course, to get rid of compiler warnings it needs to define every property explicit
and provide
@dynamicfor them.