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 > newbie developer confused.?

newbie developer confused.?
Thread Tools
Mac Enthusiast
Join Date: Jan 2001
Location: ny ny usa
Status: Offline
Reply With Quote
Apr 18, 2001, 02:06 PM
 
I am cool with the concept of Cocoa and Carbon being two seperate application environments. I am having trouble figuring out where stuff like CoreFoundation, CoreServices and CoreApplicationServices fit with cocoa and cabron. Carbon and Cocoa have two syntax's and structural differences. Carbon strucured, Cocoa object oriented. carbon C, Cocoa Objective C. So how does one access these low level services from the high level application environments? For instance how would I access HFS+ functions from within a Cocoa environment?
'Satisfy the urge and discover the need' Q-Tip
     
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status: Offline
Reply With Quote
Apr 18, 2001, 07:19 PM
 
I ahven't looked at them extensively, but you can use anything in Core Applications services and the like in Cocoa or Carbon. All they are, or at least the ones that I have used, are C functions. Objective C is 100% compatible with C. C++ isn't, structures are a little bit different, but they should still work there too. For example, just call a few CG functions from an Objective C method and they should work.
     
Grizzled Veteran
Join Date: Apr 2001
Status: Offline
Reply With Quote
Apr 18, 2001, 11:31 PM
 
It gets a bit confusing:

Foundation is a set of Obj C (or Java) objects that provide important services and data structures for the AppKit (the interface-related part of Cocoa). Things like NSArray, NSString, etc, are part of foundation. The "NS" prefix should be a hint that they're part of Cocoa and can't be accessed from Carbon.

However, Core Foundation is a set of C-based structures and routines that both Cocoa and Carbon can make use of. The "CF" prefix in the core foundation is your clue that either Carbon or Cocoa can access it.

Hope this helps.

Wade
     
Mac Enthusiast
Join Date: Jan 2001
Location: ny ny usa
Status: Offline
Reply With Quote
Apr 19, 2001, 11:51 AM
 
Getting more confussed

Cocoa and Carbon appear to be built on top of CoreServices, CoreFoundation and CoreApplicationServices. CoreServices appears to contain a lot of Carbon stuff like thread manager, MultiProcessing Services and FileManager to name a few. Does that mean that I can call those API from Cocoa apps? I know that Cocoa has NS Thread but still the question remains can I call CoreServices and CoreApplicationServices functions from a Cocoa app. It just looks like they are part of Carbon.


Forget about CoreFoundation for the moment I am interested in CoreServices and CoreApplicationServices.

Also the Documentation seems to be broken into 5 sections, carbon, Cocoa, Kernel, Networking and CoreFoundation. There is no section for CoreApplicationServices or CoreServices.

[This message has been edited by muchfresh (edited 04-19-2001).]
'Satisfy the urge and discover the need' Q-Tip
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Apr 20, 2001, 04:29 PM
 
You can call Cocoa code from Carbon and vice versa.

Read System Overview and possibly the Kernel Environment to get to know more about what's going on in OS X.
     
Junior Member
Join Date: Apr 2001
Location: Sunnyvale, CA
Status: Offline
Reply With Quote
Apr 21, 2001, 08:32 AM
 
Originally posted by Angus_D:
You can call Cocoa code from Carbon and vice versa.
Woa, can you give me some more specific references/details? Last I heard, there are features in Cocoa that can't be used in Carbon. Docklets and opaque windows are a couple of examples that come to mind...
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Apr 21, 2001, 04:48 PM
 
Opaque windows? They're part of Carbon by default... I don't know what you mean... Opaque dragging?

As for Docklets... well you can write bridging code, and any valid C carbon will compile with the ObjC compiler, since ObjC is a superset of C. You just need to link against Carbon.framework.....

Mixing C++ with ObjC is messy and requires bridging, there's an example on developer.apple.com/samplecode
     
   
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 01:21 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