[Pyobjc-dev] Fwd: I assume a similar fix would make initWithHTML work?
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-03-24 18:05:06
|
Direct reply got caught by TDMA (some kind of whitelisting software). Begin forwarded message: > From: Ronald Oussoren <ous...@ci...> > Date: Mon Mar 24, 2003 18:50:54 Europe/Amsterdam > To: Rod Morehead <rm...@rm...> > Subject: Re: I assume a similar fix would make initWithHTML work? > > Yes, the signature strings for init methods should all start with > '@@:' or '@0@4:8' (the latter are magic numbers generated by the > compiler, but strangely enough not by the runtime). > > Ronald > > On Monday, Mar 24, 2003, at 18:21 Europe/Amsterdam, Rod Morehead wrote: > >> Message: 4 >> Date: Mon, 24 Mar 2003 09:01:47 +0100 >> Subject: Re: [Pyobjc-dev] >> NSAttributedString.initWithPath_documentAttributes_ >> Cc: pyo...@li... >> To: Steve Reeves <st...@sy...> >> From: Ronald Oussoren <ous...@ci...> >> >> >> 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 >> >> > |