ios - Xib fatal error -
i have .xib called contentview.xib
, set custom class subview of uiview. error when try , run app:
fatal error: init(coder:) has not been implemented:
here code:
class contentview: uiview { override init() { super.init(frame: cgrect( x: 0, y: 0, width: screen.width, height: screen.height)) nsbundle.mainbundle().loadnibnamed("contentview", owner: self, options: nil) } required init(coder adecoder: nscoder) { super.init(coder: adecoder) fatalerror("init(coder:) has not been implemented:") }
i have looked nscoder , couldn't find fix it.
it because of code:
fatalerror("init(coder:) has not been implemented:")
you raising assertion , crashing app yourself, remove code, work well.
Comments
Post a Comment