Re: [Pyobjc-dev] NSFont.alloc() no more needed?
Brought to you by:
ronaldoussoren
From: Bob I. <bo...@re...> - 2004-02-17 13:56:38
|
On Feb 17, 2004, at 8:14 AM, Dinu Gherman wrote: > Something weird is going on... I often use code like this: > > from AppKit import NSFont > f = NSFont.alloc().fontWithName_size_("Courier", 12) > > which worked perfectly well until very recently, giving me now: > > AttributeError: 'NSFont' object has no attribute 'fontWithName_size_' > > I'm getting this on PyObjC 1.1 a0 as well as on the CVS version. > But when moving to the following syntax things magically work > as they did before: > > f = NSFont.fontWithName_size_("Courier", 12) > > The only possible explanation I can come up with is that I've > recompiled libffi inbetween. Is the alloc() no longer needed > or has libffi changed or has anybody else a good explanation? ClassName.alloc().classMethod() has never been correct code. This pythonism was intentionally changed in PyObjC to accommodate for the fact that ObjC has separate namespaces for instance methods and class methods (class methods are really metaclass methods in ObjC). -bob |