title: How to mark designated initializers of super class "invalid" in Objective-C?
body: <p>From the <a href="https://developer.apple.com/library/mac/releasenotes/ObjectiveC/ModernizationObjC/AdoptingModernObjective-C/AdoptingModernObjective-C.html" rel="noreferrer">Adapting Modern Objective-C document</a>:</p>
  <blockquote>
  <p>If a class provides one or more designated initializers, it must implement all of the designated initializers of its superclass.</p>
  </blockquote>
  <p>That means if I have a subclass of <code>NSObject</code> that has its own designated initializer, say</p>
  <pre><code>- (instancetype)initWithImage:(UIImage*)image NS_DESIGNATED_INITALIZER;
  </code></pre>
  <p>then I also need to provide an implementation of NSObjects <code>-init</code>. What should I do to mark the <code>-init</code> initializer as &quot;invalid&quot;, i.e., nobody should call it but use <code>-initWithImage:</code> instead? What's best practice here?</p>
  <h3>Edit</h3>
  <p>I tried the techniques described <a href="https://stackoverflow.com/questions/195078/is-it-possible-to-make-the-init-method-private-in-objective-c">here</a>.</p>
  <p>However, when I mark the superclass <code>-init</code> method as <code>unavailable</code> in the interface, the compiler still tells me that I need to overwrite the initializer of the superclass.</p>
  <p>When I try the other techniques, i.e., raising an exception or calling <code>-doesNotRecognizeSelector:</code> inside of <code>-init</code>, I get an error stating that I need to call one of my designated initializers.</p>