ios - Nil Enherited outlet on the subclass -


i've defined base class outlet , attached outlet view in nib file

class basecontroller: uiviewcontroller  {   @iboutlet weak var myview : uiview!  , created subclass   class subviewcontroller: basecontroller {  override func viewdidload() { myview.backgroundcolor = uicolor.red //the app crashes here  

when call basecontroller() view appears, when call subviewcontroller() app crashes because myview nil. files owner on nib file basecontroller.

try create custom initializer in subclass:

init() {     super.init(nibname: "basecontroller", bundle: nil) } 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -