PYObjC NSWindow is NoneType?
window = NSApplication.sharedApplication().mainWindow()
window.contentView().addSubview_(chart_view)
The window was made in another section and appears fine but I get开发者_开发问答 this:
: 'NoneType' object has no attribute 'contentView'
Does anyone know why it thinks the window is "NoneType"? Thankyou.
It looks like mainWindow() is returning None, which suggests that there is no active window or something like that.
Did you remember to connect the window outlet in the .xib?
加载中,请稍侯......
精彩评论