Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jeremy.king

macrumors 603
Original poster
Jul 23, 2002
5,479
1
Holly Springs, NC
Can you intermix languages when writing a Cocoa application? I would love to leverage some of my java skills, as well as some Open Source APIs, AND use Obj-C...I know when you start a project, it asks what language you are going to use. Has anyone done this? Is it possible?
 

iMeowbot

macrumors G3
Aug 30, 2003
8,634
0
http://cocoadevcentral.com/articles/000024.php

When you start a project, it's really asking what language will be at the core. The above documents how to pull in Java, and there really isn't anything special about using ordinary C functions in ObC, just go ahead and #include and call 'em from inside your ObjC methods.
 

GeeYouEye

macrumors 68000
Dec 9, 2001
1,669
10
State of Denial
While you can't use Java and Obj-C together, you can use Obj-C and C and C++ together (known as Objective-C++). You give your implementation files a .mm extension, and so long as you use right Obj-C vs. C++ syntax for the right objects, you'll have no problems.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.