Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 5, 2009, 05:55 PM   #1
Dragonlance1561
macrumors member
 
Join Date: Aug 2007
Objective-C/Cocoa cross platform compatibility.

I have been looking around on the web and I have seen mixed answers about Objective-C and Cocoa being compatible with windows and linux and other OS's. I'm thinking that Objective-C is while Cocoa is not. Am I correct?

Last edited by Dragonlance1561; Feb 5, 2009 at 06:01 PM.
Dragonlance1561 is offline   0 Reply With Quote
Old Feb 5, 2009, 06:24 PM   #2
ray648
macrumors regular
 
Join Date: Jan 2008
Yes, you are correct. Objective C can be compiled on any platform with a suitable compiler, including windows and linux, but Cocoa is apple specific.
ray648 is offline   0 Reply With Quote
Old Feb 5, 2009, 06:33 PM   #3
Cromulent
macrumors 603
 
Cromulent's Avatar
 
Join Date: Oct 2006
Location: The Land of Hope and Glory
Depends. As far as I know Objective-C 2 is Apple only still.
__________________
Neural Advance - Mac OS X, UNIX and Windows Development
Last.fm Profile | Extreme Metal Reviews
MP 4x 2.66Ghz Xeons / 6GB RAM / 640GB + 500GB + 750GB + 1TB HDDs / ATI Radeon 4870 / iPad 3
Cromulent is offline   0 Reply With Quote
Old Feb 5, 2009, 06:49 PM   #4
ChrisA
macrumors G4
 
Join Date: Jan 2006
Location: Redondo Beach, California
Quote:
Originally Posted by Dragonlance1561 View Post
..Objective-C and Cocoa being compatible with windows and linux and other OS's. I'm thinking that Objective-C is while Cocoa is not.
You are correct.

Apple uses the Open Source gcc compiler as part of x-code. gcc runs on every computer and OS known to man (almost) and gcc does Objective-C (and C, C++, FORTRAN, Ada and Java as well). So the language itself is portable to every place that gcc runs.

Cocoa however is Mac-only.

OK
ChrisA is offline   0 Reply With Quote
Old Feb 5, 2009, 10:06 PM   #5
Dragonlance1561
Thread Starter
macrumors member
 
Join Date: Aug 2007
ok thanks, I'm learning C++ now, how transferable is knowledge of C++ to Objective-C? From what I have read it's quite transferable.

Also, can anyone point me to any websites or books that will teach me to make GUI's on other OS's (mostly windows) in Objective-C and/or C++?

I want to be able to write my source code on my mac so I can't use MS Visual C++ for windows. Linux isn't a big issue, mainly windows i want to run my programs on, and I know i can just use interface builder on mac. (but learning the hard way is always a bonus)

EDIT!: Even better would be books or websites about making cross-platform GUI's if possible.

Last edited by Dragonlance1561; Feb 6, 2009 at 01:03 AM.
Dragonlance1561 is offline   0 Reply With Quote
Old Feb 5, 2009, 10:48 PM   #6
sanPietro98
macrumors 6502a
 
sanPietro98's Avatar
 
Join Date: May 2008
Location: 28.416834,-81.581214
Has anyone here tried using Cocotron? They claim to make a subset of cocoa multiplatform. I'd be interested to hear any experiences.
__________________
"The more you like yourself, the less you are like anyone else, which makes you unique." -Walt Disney
sanPietro98 is offline   0 Reply With Quote
Old Feb 6, 2009, 01:18 AM   #7
Cromulent
macrumors 603
 
Cromulent's Avatar
 
Join Date: Oct 2006
Location: The Land of Hope and Glory
Quote:
Originally Posted by Dragonlance1561 View Post
ok thanks, I'm learning C++ now, how transferable is knowledge of C++ to Objective-C? From what I have read it's quite transferable.

Also, can anyone point me to any websites or books that will teach me to make GUI's on other OS's (mostly windows) in Objective-C and/or C++?

I want to be able to write my source code on my mac so I can't use MS Visual C++ for windows. Linux isn't a big issue, mainly windows i want to run my programs on, and I know i can just use interface builder on mac. (but learning the hard way is always a bonus)

EDIT!: Even better would be books or websites about making cross-platform GUI's if possible.
Windows uses Win32 or the .Net platform to do its GUI programming. Mac OS X uses Carbon or Cocoa. No matter what you do you will need to write separate code for the GUIs for each platform.

A better solution would be to use the Qt framework which is written in C++ and works on Windows, Mac OS X and Linux and would allow you to do all your GUI programming for all platforms on the Mac and would just require a recompile on the other platforms (assuming of course the rest of your code is platform agnostic).

Edit : Of course this means you won't be able to use Interface Builder at all but would need to use Qt Designer to build your GUIs. See http://www.trolltech.com/qt for more information.

Oh and as long as the applications you write are open source it is free. If you want to write commercial software you need to pay a license fee.
__________________
Neural Advance - Mac OS X, UNIX and Windows Development
Last.fm Profile | Extreme Metal Reviews
MP 4x 2.66Ghz Xeons / 6GB RAM / 640GB + 500GB + 750GB + 1TB HDDs / ATI Radeon 4870 / iPad 3
Cromulent is offline   0 Reply With Quote
Old Feb 6, 2009, 03:40 AM   #8
Dragonlance1561
Thread Starter
macrumors member
 
Join Date: Aug 2007
Quote:
Originally Posted by Cromulent View Post
Edit : Of course this means you won't be able to use Interface Builder at all but would need to use Qt Designer to build your GUIs. See http://www.trolltech.com/qt for more information.
That sounds great to me. I would rather just learn C++ for now anyways.
Quote:
Originally Posted by Cromulent View Post
Oh and as long as the applications you write are open source it is free. If you want to write commercial software you need to pay a license fee.
I am doing this for personal use and school work, no commercial use intended.

P.S.
Quote:
Originally Posted by Cromulent View Post
(assuming of course the rest of your code is platform agnostic).
What does agnostic mean I never seen that word before.
Dragonlance1561 is offline   0 Reply With Quote
Old Feb 7, 2009, 09:38 PM   #9
Cromulent
macrumors 603
 
Cromulent's Avatar
 
Join Date: Oct 2006
Location: The Land of Hope and Glory
Quote:
Originally Posted by Dragonlance1561 View Post
What does agnostic mean I never seen that word before.
Well when used in the religious sense it means undecided basically. So when used in the programming sense it basically means cross platform compatible as you have not decided on which platform to use. Does that make sense?
__________________
Neural Advance - Mac OS X, UNIX and Windows Development
Last.fm Profile | Extreme Metal Reviews
MP 4x 2.66Ghz Xeons / 6GB RAM / 640GB + 500GB + 750GB + 1TB HDDs / ATI Radeon 4870 / iPad 3
Cromulent is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting 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

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
formatting an ipod to fat 32 for cross platform compatability Sossity Windows, Linux & Others on the Mac 1 Feb 22, 2011 04:42 PM
Cross Platform KVM--Help!!!!! tarigaad Buying Tips, Advice and Discussion (archive) 8 Nov 8, 2003 12:02 PM
Need a KVM switch that will work cross platform ctowle General Mac Discussion 3 Nov 7, 2003 12:14 AM
Free and easy cross platform benchmarking tool stoid General Mac Discussion 3 Sep 25, 2003 07:32 PM
Mozilla Thunderbird 0.1 - a cross platform stand alone mail ... MacBytes New Mac Application Announcements 3 Jul 29, 2003 09:19 AM


All times are GMT -5. The time now is 10:46 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC