Re: [Pyobjc-dev] issues with NSURL and NSWindow?
Brought to you by:
ronaldoussoren
From: b.bum <bb...@ma...> - 2004-04-05 03:37:43
|
On Apr 4, 2004, at 8:18 PM, James Eagan wrote: > I've been doing more with PyObjC lately, and I've been having a few > weird issues creep up.... The first one's probably the easiest to > demonstrate: > > Python 2.3 (#1, Sep 13 2003, 00:49:11) > [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> from Foundation import * > >>> u = NSURL.alloc().initWithString('http://pyobjc.sf.net') > Bus error > % That should be: >>> from Foundation import * >>> u = NSURL.alloc().initWithString_('http://pyobjc.sf.net') But the incorrect form shouldn't bus error, either... > Also, it appears that the NSWindow doesn't implement the -isKeyWindow > and -isMainWindow methods: 'objc.native_selector' object has no > attribute 'isMainWindow' > > That error occurs when I call MyAppController.window.isMainWindow() > where MyAppController.window is an IBOutlet of type NSWindow. Do you mean that 'window' is an outlet of type NSWindow? The error message indicates that whatever is found via the '.window' is a method, not a reference to a window object. So, MyAppController.window().isMainWindow() might "just work", but I'm still confused. What is MyWindowController? The naming implies that it is a class of some kind... b.bum |