Default property values not set in an instantiated view controller when it is a concrete subclass of a type-generic uiviewcontroller (Swift)

Originator:michele.titolo
Number:rdar://23737778 Date Originated:12/2/2015
Status:Open Resolved:
Product:iOS SDK Product Version:iOS 9.1
Classification:Serious Bug Reproducible:Always
 
Summary:
All default property values are missing for a UIViewController that's a subclass of a generic class after instantiation. These do not become available until after the view has been loaded.

UIViewControllers that do not subclass a generic class do not have this problem. This is specifically an issue with generics and view controllers.

The default values are not nil. They are in some partially initialized state. For example, if I interact with `rows` in lldb I can do a few things, but not everything:

(lldb) p rows
([Int]) $R1 = 0 values {}
(lldb) po rows
0 values
 {}
(lldb) po rows.enumerate()
 {
  base = 0 values {}
}
(lldb) po rows.count
error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x10).
The process has been returned to the state before expression evaluation.

And if I create another property with a default value, var foo = "Foo", it becomes an empty string:

(lldb) p foo
(String) $R0 = ""
(lldb) po foo
""

So it's not that these aren't initialized, it's that they aren't initialized properly.

Steps to Reproduce:
1. Open sample project in Xcode
2. Build & Run
3. Press button twice (because of rdar://23737527)
4. EXC_BAD_ACCESS is thrown

Expected Results:
I expect default values to be set on the view controller after it has been initialized

Actual Results:
The default values are not set after instantiation if a view controller is a concrete subclass of a type-generic class

Version:
iOS 9.1 & Xcode 7.1

Notes:


Configuration:
All

Attachments:
'StoryboardNotInitialized.zip' was successfully uploaded.

http://cl.ly/1n1c2Z2M2L2h

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!