Re: [Pyobjc-dev] In and out of NSData
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-01-08 21:53:13
|
On Wednesday, Jan 8, 2003, at 15:56 Europe/Amsterdam, bb...@ma... wrote: > On Wednesday, Jan 8, 2003, at 01:24 US/Eastern, Ronald Oussoren wrote: >>> Is there currently any way to do (pyobjc) NS* <-> (Carbon.CF) CF* >>> for the toll-free bridged types? I don't see anything obvious from >>> a quick look. > > It isn't necessary. Toll-free means that they are effectively one in > the same. > > In ObjC, if you have.... > > CFDataRef foo; // basically, CFData *foo > > > .... you can: > > [foo bytes]; > > That is, CFData * and NSData * are *exactly the same* as far as the > ObjC runtime and CF*() APIs are concerned. But Python doesn't know that. We'll have to add functions that will basicly perform pointer casts. Remember that we use one set of types to wrap NS* objects (PyObjC) and another set to wrap CF* objects (part of the python core). The functions will have to extract a pointer from one kind of wrapper and stuff it into another one. Ronald |