title: Protected variables with modern objective-C?
body: <p>I feel that modern Objective-C encourages using instance variables as properties for memory management and key-value observation. That works fine, and I'm using interface inside implementation file for private variables, like this:</p>
  
  <pre><code>@interface MyClass ()
  @property NSObject* myVar;
  @end
  </code></pre>
  
  <p>However, how can I make protected variables? In case above, my subclasses won't be able to see properties declared like that. I can go iVar route, but then it feels off with the rest of the code if private variables are declared like above and protected are iVars.</p>
  
  <p>I've read this solution: <a href="https://stackoverflow.com/questions/11047351/workaround-to-accomplish-protected-properties-in-objective-c">Workaround to accomplish protected properties in Objective-C</a>, but it seems to overcomplicate code too much.</p>