开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜