Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 5, 2009, 06: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 07:01 PM.
Dragonlance1561 is offline   0 Reply With Quote
Old Feb 5, 2009, 07: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, 07: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, 07: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, 11: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 02:03 AM.
Dragonlance1561 is offline   0 Reply With Quote
Old Feb 5, 2009, 11: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, 02: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, 04: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, 10: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

Similar Threads
thread Thread Starter Forum Replies Last Post
Staying cross-platform? MacNoobGuy Mac Applications and Mac App Store 10 Dec 29, 2013 05:19 AM
Cross-platform apps Navdakilla Alternatives to iOS and iOS Devices 7 Dec 4, 2013 09:09 PM
Which is the best cross platform for development? Wilbor9 iPhone/iPad Programming 6 Aug 6, 2013 07:09 AM
Cross platform Apps? gman901 iPad Apps 0 Jan 16, 2013 05:45 PM
Cross-Platform Novel Writing: Is There An App For That? Master Fwiffo Mac Applications and Mac App Store 8 Oct 31, 2012 07:56 PM

Forum Jump

All times are GMT -5. The time now is 02:24 PM.

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

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