title: Readonly Properties in Objective-C?
body: <p>I have declared a readonly property in my interface as such:</p>
  
  <pre><code> @property (readonly, nonatomic, copy) NSString* eventDomain;
  </code></pre>
  
  <p>Maybe I'm misunderstanding properties, but I thought that when you declare it as <code>readonly</code>, you can use the generated setter inside of the implementation (<code>.m</code>) file, but external entities cannot change the value. <a href="https://stackoverflow.com/questions/1876495/objective-c-accessor-declarations-readonly-readwrite-etc">This SO question</a> says that's what should happen. That is the behavior I'm after. However, when attempting to use the standard setter or dot syntax to set <code>eventDomain</code> inside of my init method, it gives me an <code>unrecognized selector sent to instance.</code> error. Of course I'm <code>@synthesize</code>ing the property. Trying to use it like this:</p>
  
  <pre><code> // inside one of my init methods
   [self setEventDomain:@"someString"]; // unrecognized selector sent to instance error
  </code></pre>
  
  <p>So am I misunderstanding the <code>readonly</code> declaration on a property? Or is something else going on? </p>