Re: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS)
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.