Re: [Pyobjc-dev] 10.8, 10.9, NSDocument, TypeError, "cannot change a method"
Brought to you by:
ronaldoussoren
|
From: Erik v. B. <er...@le...> - 2013-08-31 13:52:35
|
Hi Ronald,
thanks for the clue. I think I've localised the problem.
On 29 aug. 2013, at 13:37, Ronald Oussoren <ron...@ma...> wrote:
>
> This means that your document class problably has an attribute that has the same name as a method that is new in OSX 10.9.
This script shows the 10.9 NSView has a backgroundColor method.
from AppKit import NSView, NSColor
class MyView(NSView):
def init(self):
self = super(MyView, self).init()
self.backgroundColor = NSColor.lightGrayColor()
return self
print MyView.alloc().init()
On 10.8.4:
> <MyView: 0x7fe65620eaa0>
On 10.9 (13A558):
> Traceback (most recent call last):
> File "/Volumes/erik/Desktop/test.py", line 10, in <module>
> print MyView.alloc().init()
> File "/Volumes/erik/Desktop/test.py", line 7, in init
> self.backgroundColor = NSColor.lightGrayColor()
> TypeError: cannot change a method
Cheers,
Erik
|