Re: [Pyobjc-dev] NSAttributedString.initWithPath_documentAttributes_
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-03-24 08:02:47
|
On Monday, Mar 24, 2003, at 08:16 Europe/Amsterdam, Steve Reeves wrote: > I'm trying to load some data into an NSAttributedString with the > initWithPath_documentAttributes_ method (or one of the other > initWith... > variants in AppKit) and am having trouble: > > ~ % /usr/bin/python > Python 2.2 (#1, 07/14/02, 23:25:09) > [GCC Apple cpp-precomp 6.14] on darwin > Type "help", "copyright", "credits" or "license" for more information. >>>> import objc >>>> import Foundation >>>> import AppKit >>>> foo = Foundation.NSAttributedString.alloc() >>>> foo. initWithPath_documentAttributes_('aFile', objc.nil) > Traceback (most recent call last): > File "<stdin>", line 1, in ? > objc.internal_error: objc_sizeof_type: Unhandled type '0x38 That's a bug, but luckily an easy to solve one. I've just checked in a fixed for this. A quick fix would be to change objc/_FoundationSignatures.py. Look for 'initWithPath:documentAttributes:' and add '@@:' at the start of the signature string (currently starting with '8'). Your code still won't work with that version: The last argument of the method is an output parameter, those are not present in the python argument list. The last call should be: foo, documentAttributes = foo.initWithPath_documentAttributes_('aFile') Ronald |