image
image

Go Back   macosx.com > Design, Media, Programming & Scripting > Software Programming & Web Scripting

Reply
 
LinkBack Thread Tools
  #1  
Old May 20th, 2002, 09:04 AM
iconara's Avatar
Registered User
 
Join Date: Sep 2000
Location: Gothenburg, Sweden
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
iconara is on a distinguished road
CoreFoundation => Foundation

I have a CFDictionaryRef and want to make a NSDictionary out of it. Any suggestions on how to do it? The manual way is a possibility, but I rather have a nice little method somewhere, like +dictionaryWithCFDictionayRef: ... both the CoreFoundation and Foundation documentation seems to avoid this topic.




theo/iconara
Reply With Quote
  #2  
Old May 22nd, 2002, 06:35 AM
iconara's Avatar
Registered User
 
Join Date: Sep 2000
Location: Gothenburg, Sweden
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
iconara is on a distinguished road
it's a pity having to answer one's own questions...

this is the way to do it:

Code:
CFDictionaryRef cfDict = CFDictionaryCreate(...);
NSDictionary *nsDict = (NSDictionary *)cfDict;
It's actally possible to cast one type to the other. This will result in a compiler warning, but one can just ignore that....


Ugly.
Reply With Quote
  #3  
Old May 24th, 2002, 04:32 AM
Registered User
 
Join Date: Nov 2001
Location: Vicenza - Italy
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
mkneith is on a distinguished road
That's why they call it "toll free bridging" you just cast the type (you shouldn't get any warnings: never got one).
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Upgrade XFree86 4.1 => XFree864.2 bright Mac OS X System & Mac Software 1 February 1st, 2002 07:37 AM
Attention Dave X and NetBarrier X => Kernel Panic !!! Tuvok Mac OS X System & Mac Software 3 December 12th, 2001 01:19 PM


All times are GMT -5. The time now is 10:51 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC1
Copyright 2000-2010 DigitalCrowd, Inc.