title: Setting read only property a value
body: <p>I have a read only property</p>
  
  <pre><code>@property (nonatomic, readonly)  NSInteger   keepalive;
  </code></pre>
  
  <p>With a getter method</p>
  
  <pre><code>-(NSInteger)keepalive
  {
      return _keepalive / 1000;
  }
  </code></pre>
  
  <p><strong>ERROR - Use of undeclared identifier</strong> </p>
  
  <p>And trying to set a value in <code>init</code> method</p>
  
  <pre><code>- (instancetype)init
  {
      self = [super init];
  
      if (self)
      {
          _keepalive = 25000;
      }
      return self;
  }
  </code></pre>
  
  <p><strong>ERROR - Use of undeclared identifier</strong> </p>
  
  <p>Couldn't understand the reason why and what's the right way to have a readonly property, with a getter.</p>
  
  <p>EDIT:
  I wouldn't want to add <code>synthesize</code> as suggested in the comment, since it's not needed anymore - <a href="https://stackoverflow.com/a/14658849/978133">as stated here</a> AND I got the correct answer below.
  Thank you André Slotta!</p>