View Full Version : Cocoa - Obj C and Java?
jeremy.king
Sep 24, 2004, 11:21 AM
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
Sep 24, 2004, 12:45 PM
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.
jeremy.king
Sep 24, 2004, 12:47 PM
Thanks Meow.
I just can wait til I get my two books (hopefully today), so I can get started on writing Apps for OS X.
GeeYouEye
Sep 26, 2004, 10:32 PM
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.
vBulletin® v3.6.10, Copyright ©2000-2009, Jelsoft Enterprises Ltd.