xcode - webview strong iboutlet in delegate is nil, awakefromnib never called -
currently converting obj-c framework swift. in delegate have class iboutlet webview (i defined strong) when try set url (first block phwebviewcontroller):
var parent : phfacebook? override func awakefromnib() { let bundle = nsbundle(forclass: phfacebook.self) self.window.title = bundle.localizedstringforkey("fbauthwindowtitle", value: "", table: nil) self.cancelbutton.title = bundle.localizedstringforkey("fbauthwindowcancel", value: "", table: nil) self.window.delegate = self self.window.level = int(cgwindowlevelforkey(.floatingwindowlevelkey)) } var webviewcontroller : phwebviewcontroller? self.webviewcontroller = phwebviewcontroller() self.webviewcontroller!.parent = self self.webviewcontroller!.webview .mainframeurl = authurl
my osx app crash , xcode tells me found nil while unwrapping optionnal. have same issue : swift, error exc_breakpoint (code=1, subcode=0x100695474)
except me iboutlet connected strong attribute. did check, webviewcontroller property not nil webview is. thought xib file might corrupted created one, made outlets again nothing changed.
anybody had same issue before?
for interesting answer, in order load xib file used :
nsbundle.mainbundle().loadnibnamed("facebooklogin", owner: self.webviewcontroller, toplevelobjects: nil)
Comments
Post a Comment