Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > calling cocoa from carbon

calling cocoa from carbon
Thread Tools
Professional Poster
Join Date: Sep 2000
Location: Texas
Status: Offline
Reply With Quote
Mar 3, 2004, 01:44 PM
 
Does anyone know an easy way to do this... I have a semi working prototype using the CocoaInCarbon example on Apple's website. It keeps dying on:

bundleRef = CFBundleCreate(NULL, bundleURL);

where bundleRef is a CFBundleRef. It returns NULL. The bundleURL is not NULL, so it *should* work. Is there an easier way then using Apple's code as a base?
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Mar 3, 2004, 02:05 PM
 
Well, CFBundleCreate will return NULL for a reason - probably that you didn't actually pass in a valid URL to a bundle.
     
Professional Poster
Join Date: Sep 2000
Location: Texas
Status: Offline
Reply With Quote
Mar 3, 2004, 02:10 PM
 
the CFURL that I am passing does not return NULL. Is there a way to check other than is bundleURL == NULL?
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Mar 3, 2004, 02:40 PM
 
Are you sure the CFURL refers to a valid bundle?
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Professional Poster
Join Date: Sep 2000
Location: Texas
Status: Offline
Reply With Quote
Mar 3, 2004, 03:24 PM
 
Originally posted by Chuckit:
Are you sure the CFURL refers to a valid bundle?
Let's see how vague of an answer I can give....

I Do Not Know

How can I check other then seeing if it is NULL?
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Mar 3, 2004, 04:54 PM
 
Originally posted by djohnson:
How can I check other then seeing if it is NULL?
No, not the CFURLRef, but the actual URL path on disk that you are trying to use. This path must be a directory for you to create a CFBundle from it.
     
Professional Poster
Join Date: Sep 2000
Location: Texas
Status: Offline
Reply With Quote
Mar 3, 2004, 09:43 PM
 
What format does the URL path need? Apple's documentation does not elaborate enough for me to completely understand it. Thanks!
     
Professional Poster
Join Date: Sep 2000
Location: Texas
Status: Offline
Reply With Quote
Mar 4, 2004, 02:03 AM
 
Here is a good link:

http://developer.apple.com/documenta...1516/TPXREF147

I think I found my problem. I had the bundle in the Resources instead of Frameworks folder. I will fix a few things and see if it works...
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Mar 5, 2004, 07:07 PM
 
Originally posted by djohnson:
What format does the URL path need? Apple's documentation does not elaborate enough for me to completely understand it. Thanks!
What do you mean, "format"? The URL must be a filesystem path that points to a bundle. If you don't know what that means, go look at the Mac OS X Bundles conceptual overview.
     
   
Thread Tools
Forum Links
Forum 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 On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:59 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2