0

Why do superclass properties not get passed on to a subclass unless they are defined in the public API?

For example, if I declare @property in class1.m (but I want it to be private to the class so I don't declare it in class1.h), and then I create class2 and inherit from class1, why don't I get access to the same @property? What is the correct way of implementing this, either making the @property public or re-declare it in the subclass?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • You do get access to them. Just use `[super foo]` and `[super setFoo:]`. –  Nov 24 '13 at 22:54
  • 1
    No private ivars or private properties can be accessed from any other class, including subclasses. That's the point of making them private. – rmaddy Nov 24 '13 at 23:00

0 Answers0