UIStoryboard fails to instantiate view controller the first time when the view controller is a concrete subclass of a generic view controller (Swift)
| Originator: | michele.titolo | ||
| Number: | rdar://23737527 | Date Originated: | 12/2/2015 |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | iOS 9.1 |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: Given a UIVC that has a generic superclass, instantiation does not behave consistently. It fails the first time a particular class is instantiated, but works every time thereafter for a storyboard while it is in memory. Steps to Reproduce: 1. Open either sample project 2. Build + Run 3. Tap one of the buttons 4. A message will print to the console: "2015-12-02 20:51:12.803 MoarTests[7286:1128104] Unknown class _TtC9MoarTests20PurpleViewController in Interface Builder file." 5. Tap the same button a second time, and success message prints: "Hello I am a <MoarTests.PurpleViewController: 0x7f994b5485c0>" Expected Results: I expect instantiateViewControllerWithIdentifier to either fail consistently when dealing with generic view controllers or be able to handle them appropriately Actual Results: The view controller is not instantiated ONLY THE FIRST TIME instantiateViewControllerWithIdentifier is called for that particular class. All calls thereafter work as expected. Instantiating one generic view controller subclass does not mean others will work. This happens on a class by class basis. Version: iOS 9.1 & Xcode 7.1 Notes: Configuration: All Attachments: 'StoryboardGenericFail.zip' and 'StoryboardMultipleGenerics.zip' were successfully uploaded. http://cl.ly/1G0R082n3q3c http://cl.ly/2h1P2g250w1j
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!