Say I create an object in class Foo called Bar. Bar's delegate is Foo and I want to access a variable from Foo like this [self.delegate variable]
. Not surprisingly, this will work but give a warning saying "No -variable method found" So my question is, how do I declare that I want this variable to be accessed by a delegate without rewriting the getters and setters?
For example, if I wanted to declare delegate methods, it would look something like this:
@interface NSObject(Foo)
- (void)someMethod;
@end
How do I do the same with variables?