I have a data model which is similar to this:
(in another project)
________________________________ _______________________
| | | |
| Graph | | DetailedGraph |
| GraphListener lstnr | | (needs to access foo) |
| NSString foo | <----|_______________________|
| ____________________________ |
| | GraphListener | | _______________________
| | Graph enclosing | | | |
| | (also needs to access foo) | | | OtherClass |
| |____________________________| | | (cannot access foo) |
|________________________________| |_______________________|
Now, my problem is, that GraphListener is supposed to be an inner class, which cannot be done in objc, so I have this solution:
@interface Graph_Listener
{
@private
Graph *enclosing;
}
@end
@interface Graph
{
@package
NSString *foo;
}
@end
Now, my problem is, when I come to subclassing Graph
, and making the DetailedGraph
class, which is in another project, and still needs to access foo
, How can I accomplish that (I would prefer not to use properties, because the variable foo
shouldn't be accessed outside of GraphListener
and DetailedGraph
.