使用 Swift 1.1和 Xcode 6.2。
I have a UIStoryboard containing a singular, custom UIViewController subclass. On it, I have an @IBOutlet connection of type UIView from that controller to a UIView 子类 on the storyboard. I also have similar outlets for subviews of that view. See figure A.
但是在运行时,这些属性是 nil (图 B)。尽管我已经保证我已经连接了 Interface Builder 的电源插座。
思想 :
awakeFromNib:没有接到电话我尝试过的事情:
@IBOutlet和故事板项目类型(而不是 UIView)
图 A *

图 B
* Figure A中模糊的代码是:
@IBOutlet private var annotationOptionsView: UIView!
@IBOutlet private var arrivingLeavingSwitch: UISegmentedControl!
Thank you.