Xcode warns against not implementing the superclass designated initializer, even if it is marked unavailable in the subclass

Originator:s.h.meadley
Number:rdar://21302875 Date Originated:09-Jun-2015 10:27 AM
Status:Duplicate of 20281322 (Closed) Resolved:
Product:iOS SDK Product Version:Version 7.0 beta (7A120f)
Classification:Other bug Reproducible:Yes
 
Summary:
Xcode 7 issues a compiler warning if a subclass with a custom designated initializer (specified using NS_DESIGNATED_INITIALIZER) does not implement the superclass designated initializer, even if the superclass designated initializer is marked unavailable (NS_UNAVAILABLE). This behaviour has changed between Xcode 6.x and Xcode 7.

Steps to Reproduce:
Attached sample project illustrates the issue. In summary;

1) Subclass NSObject
2) Create custom designated initializer on subclass, mark is NS_DESIGNATED_INITIALIZER
3) Mark inherited init method unavailable using NS_UNAVAILABLE
4) Warning issued; "Method override for the designated initializer of the superclass '-init' not found"

Expected Results:
No warning is issued if the subclass designated initializer is marked unavailable (NS_UNAVAILABLE)

Actual Results:
Warning is issued

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!