• 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: "Toll free bridged" types
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Toll free bridged" types


  • Subject: Re: "Toll free bridged" types
  • From: "Clark S. Cox III" <email@hidden>
  • Date: Thu, 9 Jan 2003 07:50:59 -0500

On Wednesday, Jan 8, 2003, at 21:25 US/Eastern, ryan wrote:

Hi,

I'm investigating the "toll free bridged" types in CoreFoundation/Cocoa.
According to the documentation, certain types such as CFStringRef can be
casted to NSString * without any problem.

The question is how far does this compatibility extend? From the
documentation I can surmise that the reference counting fields are the same
in NSObject and CFTypes. But how far does that compatibility extend? Is
the type systems similar? IE: If I do:

CFStringRef stringRef = CFStringCreate( ... ) ;
Id kindaString = (id) stringRef ;

Does 'kindaString' act like a NSString?

Yes, they are identical. Anything you can do to/with an NSString, you can do to/with a CFStringRef, and the other way around.

for example:

NSString *nsString = (NSString*) CFStringCreate( ... );
NSArray nsArray = (NSArray*)CFArrayCreate(...);

NSLog(@"%@", nsString);
[nsArray addObject: nsString];
[nsString autorelease];
[nsArray release];
_______________________________________________
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: 
 >"Toll free bridged" types (From: ryan <email@hidden>)

  • Prev by Date: Re: Aqua Human Interface and Safari
  • Next by Date: Re: Metal Texture Image Location
  • Previous by thread: NSStatusItem and shadowed font
  • Next by thread: Forcing NSUserDefaults being written to disk?
  • Index(es):
    • Date
    • Thread