1
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.

Matthew Mitchell
  • 5,293
  • 14
  • 70
  • 122

2 Answers2

0

Did you remember to connect the window outlet in the .xib?

Sherm Pendley
  • 13,556
  • 3
  • 45
  • 57
0

It looks like mainWindow() is returning None, which suggests that there is no active window or something like that.

Uncommon
  • 3,323
  • 2
  • 18
  • 36