Cocoa-Carbon Bridging
Cocoa-Carbon Bridging
- Subject: Cocoa-Carbon Bridging
- From: "Zameer Andani" <email@hidden>
- Date: Mon, 25 Jul 2005 17:58:25 -0700
- Thread-topic: Cocoa from carbon - mouse tracking issues
Hi, i'm new to cocoa-carbon bridging. I was wondering if someone could help.
I have the following class:
class Foo {
CFStringRef name;
~Foo() { CFRelease(name); }
}
and name has the value of "Bob" at location 0x309278.
Apparantely i should be able to do the following in Cocoa:
Foo *foo = new Foo();
.... foo->name is inititialized here
...
NSString *cocoaString = (NSString *)(foo->name);
delete(foo)
when the delete completes, cocoaString becomes invalid. I have tried everything to produce a copy: CFCreateWithCopy(), assignment, even the following:
NSString *cocoaString2 = [NSString stringWithUTF8: [cocoaString UTF8String]];
in all cases, all my strings become invalid upon delete. Anyone have any ideas on how I can actually produce a copy of a CFStringRef?
thanks
Zameer
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden