Skip navigation.
 
mlRe: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS)
FROM : Simon Stapleton
DATE : Sun Oct 20 21:47:58 2002

On Saturday, Oct 19, 2002, at 17:25 Europe/Paris, Simon Stapleton wrote:

>
> On Friday, Oct 18, 2002, at 23:13 Europe/Paris, Finlay Dobbie wrote:

>> Well... You'd need to modify CFXMLNode to make it into a toll-free
>> bridged class, and I'm not sure if the src is available (it might be
>> in CFLite, haven't checked). You can have a look at other things in
>> CFLite, like CFString, to see how it's done. Unsurprisingly, it's a
>> great big ugly mess :-)

>
> Okeydokey.  That's out then.  Poop.  I was kind of hoping it could be
> done without having to hack the CF code as well.  I'll have a shufty
> at the CF source just to see how it's done though.  Might be useful to
> know, for varying values of useful.


Oh-Kay!

By looking at the CFLite source, and playing around a fair amount (as
ever, FScriptAnywhere saved my soul), and exercising crashreporter a
_lot_, I think I now have a way to do this.  It appears that way,
anyhow - I have an skeleton 'SSXMLNode' class that is bridged to
CFXMLNode, can be cast back and forth, and seems to work reasonably
well so far - I can get the guts of the node out via ObjC calls, and
use the ObjC object in CF calls, so I'd say I'm at least 90% of the way
there.

The major downside to the way I've done this is that, as it stands,
it's tied to a particular version of CF - it needs to hack into some of
CF's private data tables in +load, and I haven't found a way of getting
the offset for a private symbol in the currently loaded version of CF,
so have had to hard code the value that `nm` gives me off the command
line.  Ack.  Off to look at the source for nm, see how it's done, I
guess.

Anyway, thanks for the pointers.  I'm gonna slap a page up on cocoadev
when I'm sure it works.

Simon
--
PGP Key Id : 0x50D0698D
--
If the answer isn't obvious, the question is a distraction. Go find an
easier question.
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlBridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS) Simon Stapleton Oct 17, 22:20
mlRe: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS) Finlay Dobbie Oct 18, 23:13
mlRe: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS) Simon Stapleton Oct 19, 17:25
mlRe: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS) Timothy Ritchey Oct 20, 03:19
mlRe: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS) Finlay Dobbie Oct 20, 11:25
mlRe: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS) Simon Stapleton Oct 20, 21:47
mlRe: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS) Simon Stapleton Oct 20, 22:27
mlRe: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS) Timothy Ritchey Oct 21, 00:55
mlRe: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS) Simon Stapleton Oct 21, 21:19