• 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
Cocoa-Carbon Bridging
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Cocoa-Carbon Bridging
      • From: John Stiles <email@hidden>
  • Prev by Date: Re: Set computer to sleep mode
  • Next by Date: Re: Which Frameworks? /Developer/SDK 10.4/System/Library/Frameworks vs System/Library/Frameworks
  • Previous by thread: Re: Set computer to sleep mode
  • Next by thread: Re: Cocoa-Carbon Bridging
  • Index(es):
    • Date
    • Thread