• 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: Timothy Ritchey <email@hidden>
  • Date: Sat, 19 Oct 2002 20:19:34 -0500

On Saturday, October 19, 2002, at 10:25 AM, 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,

Actually, CFXMLNode is defined as:

struct __CFXMLNode {
CFRuntimeBase _cfBase;
CFIndex version;
CFXMLNodeTypeCode dataTypeID;
CFStringRef dataString;
void *additionalData;
};

While CFRuntimeBase is:

typedef struct __CFRuntimeBase {
void *_isa;
#if defined(__ppc__)
uint16_t _rc;
uint16_t _info;
#elif defined(__i386__)
uint16_t _info;
uint16_t _rc;
#else
#error unknown architecture
#endif
} CFRuntimeBase;

So, the CFXMLNode you are given is already set up to be used as a full-fledged class in Objective-C, since the _isa pointer is the only thing needed to make a structure into an Obj-C class.

Okeydokey. That's out then. Poop.

CFXMLNode has all the fix'ns for bridging. You would have to create your own class definition that had the right instance variables to match the existing CF structure. I am not entirely sure whether changing the isa pointer on your own (ala node.isa = [xxXMLNode class]; ) would confuse CoreFoundation, but you might give it a try.
_______________________________________________
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.
  • Follow-Ups:
    • Re: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS)
      • From: Finlay Dobbie <email@hidden>
References: 
 >Re: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS) (From: Simon Stapleton <email@hidden>)

  • Prev by Date: [sharedWorkspace isFilePackageAtPath: path]
  • Next by Date: Re: Receiving all Key Events
  • Previous by thread: Re: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS)
  • Next by thread: Re: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS)
  • Index(es):
    • Date
    • Thread