Can't instantiate UITableViewController subclass of generic UITableViewController
Originator: | brettper | ||
Number: | rdar://28844738 | Date Originated: | 19-Oct-2016 09:49 PM |
Status: | Open | Resolved: | |
Product: | Developer Tools | Product Version: | Xcode 8 |
Classification: | Enhancement | Reproducible: | Always |
Summary: In Interface Builder, a UITableViewController subclass that inherits from another UITableViewController subclass that uses generics in its definition does not appear in the Custom Class dropdown for a UITableViewController. Manually entering the class name causes a runtime crash due to an unknown class Steps to Reproduce: In numbered format, detail the exact steps taken to produce the bug. 1. Define a UITableViewController subclass using a generic parameter, in this case an NSManagedObject subclass class CoreDataTableViewController<CDObject: NSManagedObject>: UITableViewController, NSFetchedResultsControllerDelegate { … } 2. Define another UITableViewController inheriting from the first using a specific NSManagedObject subclass - TLAActivity class TLAActivityTableViewController: CoreDataTableViewController<TLAActivity> { … } Expected Results: TLAActivityController should appear in the Class dropdown under Custom Class for any UITableViewController in Interface Builder The TLAActivityController should be instantiated correctly when the UI is created Actual Results: TLAActivityController does not appear in the Class dropdown under Custom Class for any UITableViewControllers in Interface Builder If the class name is manually entered into the Class textbox, a runtime error occurs when the object is instantiated: “Unknown class _TtC6FiveBX30TLAActivityTableViewController in Interface Builder file.” Regression: Describe circumstances where the problem occurs or does not occur, such as software versions and/or hardware configurations. Notes: There is a related post on Stack Overflow for Xcode 7 http://stackoverflow.com/questions/34534854/xcode-7-swift-2-impossible-to-instantiate-uiviewcontroller-subclass-of-generic-u
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!