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 > Interface Builder and C++

Interface Builder and C++
Thread Tools
Posting Junkie
Join Date: Jun 2001
Location: Washington DC
Status: Offline
Reply With Quote
Apr 9, 2002, 05:15 PM
 
Is it possible to use Interface Builder with a program written in C++?
     
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status: Offline
Reply With Quote
Apr 9, 2002, 05:35 PM
 
I believe that would be called Carbon, and thus the answer would be yes.

Personally, I don't do Carbon. I'm working on learning Cocoa. If you are using Cocoa, then the answer would be no. The Cocoa frameworks are Objective-C. There is the possibility of using Objective-C++, in which case you can use C++ classes and Objective-C classes in the same source file. However, Cocoa calls must still be in Objective-C format.

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
Posting Junkie
Join Date: Jun 2001
Location: Washington DC
Status: Offline
Reply With Quote
Apr 9, 2002, 05:45 PM
 
Originally posted by Detrius:
<STRONG>Personally, I don't do Carbon. I'm working on learning Cocoa. If you are using Cocoa, then the answer would be no. The Cocoa frameworks are Objective-C. There is the possibility of using Objective-C++, in which case you can use C++ classes and Objective-C classes in the same source file. However, Cocoa calls must still be in Objective-C format.</STRONG>
I would prefer to use Cocoa, but for this particular project I'll be putting an interface onto someone else's program which was written in C++.

Is Objective-C++ a reality? I thought it was still on the drawing board or something.
     
Junior Member
Join Date: Feb 2002
Status: Offline
Reply With Quote
Apr 9, 2002, 09:44 PM
 
Obj-C++ is here as of OS X 10.1. Read about it here: http://developer.apple.com/techpubs/...ctive-C++.html
self = [[JeffBinder alloc] init];
     
Junior Member
Join Date: Apr 2000
Location: San Francisco, CA
Status: Offline
Reply With Quote
Apr 10, 2002, 07:23 PM
 
Originally posted by nonhuman:
<STRONG>

I would prefer to use Cocoa, but for this particular project I'll be putting an interface onto someone else's program which was written in C++.

Is Objective-C++ a reality? I thought it was still on the drawing board or something.</STRONG>

If you want to use Cocoa, learn Objective C. Don't try to program Cocoa in C++. The Objective C++ compiler support is really intended to allow C++ and Objective C code to be link compatible, plus add some syntax so C++ and Objective-C objects/code can comingle where needed. Even though comingling of C++ and Objective C objects and syntax is allowed, you can not sub-class a Objective-C object in C++. That means you can't specialing, say, a NSString obhect in C++. Though you can write a wrapper, but why? You might as well program in Objective-C if you are primarily working with Objective-C objects.

If you really want to program in C++, you can program in Carbon, which is quite a good API, contrary to popularmyth on this BBS. You can even us IB with Carbon. The only disadvantage of Carbon is that it is procederal, so you'll either have to either write your own class framework (any good programmer can do this in a couple days), or use Apple's free C++ class library for Carbon (available with the MacApp distribution and is quite comprehensive). Programming in C++ does have the advantage the the language is an industry standard (meaning plenty of third party libraries to leverage - though objective C++ reduces this advantage) and skills are more marketable in the industry (though "language" is just a means to an end for any good programmer, and not the end itself).

Michael
--
Michael F. Kamprath
     
   
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 09:43 AM.
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