• 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: Newbie (to Cocoa) questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie (to Cocoa) questions


  • Subject: Re: Newbie (to Cocoa) questions
  • From: Douglas Davidson <email@hidden>
  • Date: Thu, 7 Mar 2002 12:08:02 -0800

On Thursday, March 7, 2002, at 11:12 AM, Jeff Shulman wrote:

Most of our cross-platform framework stuff is using CoreFoundation. One question is going between CF* stuff and NS* stuff (like strings). I know that NSString for example uses CFString but can I simply cast them back and forth (my ideal dream) or do they need to be converted to some intermediate form? I did search the archives for this answer but never saw a straight reply. At the very least it would be nice if either initializers for the NS* stuff can take a CF* or Apple provided some library to do this.

NSString * and CFStringRef can be used interchangeably with just a cast. The same thing holds for most of the basic CF data types with NS equivalents, although not for every CF/NS pair (it does not hold, for example, for CFBundle and NSBundle, or CFRunLoop and NSRunLoop). The general term for this is "toll-free bridging", and you should be able to find a list of the bridged types, in the release notes if nowhere else.

Next I assume everything needs to be compiled as Mach-O. We currently use (and export to third parties) CFM shared libraries. I guess we would also now have to provide/use a Framework? One problem I see is that we currently provide a single binary CFM shared library (in a bundle) which contains several merged sub-libraries. It doesn't look like you can do this with a Framework unless you use an Umbrella Framework. Alas the docs I see don't really go into Umbrella Frameworks and specifically say that third parties shouldn't use them.

If you are using Cocoa, a framework would be the typical way to go. I would recommend a single framework unless there are strong reasons to do something else. Frameworks are designed for efficient exportation of multiple APIs.

Douglas Davidson
_______________________________________________
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: 
 >Newbie (to Cocoa) questions (From: Jeff Shulman <email@hidden>)

  • Prev by Date: Re: Newbie (to Cocoa) questions
  • Next by Date: Re: NSHFSTypeCodeFromFileType troubles
  • Previous by thread: Re: Serious class cluster/toll free bridging question (was: Newbie (to Cocoa) questions)
  • Next by thread: Re: Newbie (to Cocoa) questions
  • Index(es):
    • Date
    • Thread