On Fri, Aug 29, 2008 at 1:38 PM, Allen Curtis <[EMAIL PROTECTED]> wrote: > 1. Where can I get a better understanding of the data conversion between > these different frameworks? > 2. Ultimately the device path names will appear in a ComboBox. Was it > necessary to convert the CFMutableArray to a NSMutableArray for the > datasource function?
Ultimately the most important thing to understand about toll-free bridging (the link between CF and NS data types) is that you don't have to convert anything. You *can't* convert anything. Because they aren't two different things. An NSArray *is* a CFArray. An NSMutableArray is a CFMutableArray. They are just two different names for the same type. It gets slightly tricky because the compiler doesn't know this crucial fact. So when you have a CFMutableArrayRef and you try to treat it like it was an NSMutableArray*, the compiler gets complainey. So you have to do some fancy typecasting to shut it up. But it's very important to understand that this typecast doesn't do any sort of conversion or translation or anything of the sort, it just tells the compiler to look at the exact same pointer to the exact same object in a new light. Mike _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]