• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS)


  • Subject: Re: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS)
  • From: Simon Stapleton <email@hidden>
  • Date: Sun, 20 Oct 2002 21:47:58 +0200

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@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >Re: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS) (From: Simon Stapleton <email@hidden>)

  • Prev by Date: 'sudden' CLI pbxbuild bug?
  • Next by Date: Setting font in textView not working
  • Previous by thread: Re: Bridging
  • Next by thread: Focus Ring around an NSTextView
  • Index(es):
    • Date
    • Thread