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 > Porting a Cocoa app to Windows

Porting a Cocoa app to Windows
Thread Tools
Grizzled Veteran
Join Date: Aug 2002
Location: Central Texas
Status: Offline
Reply With Quote
Oct 12, 2003, 03:41 PM
 
We're writing a major app in Cocoa for OS X. We want it to stay in Cocoa.

What I'd like to figure out is if there is a way to save 80-90% of that code in a port to windows possibly by writing a version of the project to GnuStep and getting GNUStep to work on Windows.

Does anybody have experience in our ultimate goal, and does anybody have any comments on the idea of using GNUStep on Windows?

The other choice is we may write the app in .NET on Windows at some later date.
     
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status: Offline
Reply With Quote
Oct 12, 2003, 06:17 PM
 
You could beg Apple to resurrect Yellow Box for Windows.

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
Grizzled Veteran
Join Date: Aug 2002
Location: Central Texas
Status: Offline
Reply With Quote
Oct 12, 2003, 06:25 PM
 
Well yes I thought about that. The chance of that happening was zip...so I'm looking for realistic answers.
     
Registered User
Join Date: Feb 2003
Status: Offline
Reply With Quote
Oct 13, 2003, 03:54 AM
 
Java - Write the application in pure Java, then port it to Cocoa-Java.

I think that Cocoa-Java really your only option, if you wish to port and have access to Cocoa on OS X. I do believe that you can port objective-c to Windows but you will need some commercial libraries to achieve this, but not sure exactly.

Just my 2 cents.
     
Dedicated MacNNer
Join Date: May 2003
Location: Santa Barbara
Status: Offline
Reply With Quote
Oct 13, 2003, 09:25 AM
 
Originally posted by alex_kac:
Does anybody have experience in our ultimate goal, and does anybody have any comments on the idea of using GNUStep on Windows?
Apparently, GNUStep on Windows is possible.
     
Grizzled Veteran
Join Date: Aug 2002
Location: Central Texas
Status: Offline
Reply With Quote
Oct 13, 2003, 10:18 AM
 
Originally posted by depolitic:
Java - Write the application in pure Java, then port it to Cocoa-Java.

I think that Cocoa-Java really your only option, if you wish to port and have access to Cocoa on OS X. I do believe that you can port objective-c to Windows but you will need some commercial libraries to achieve this, but not sure exactly.

Just my 2 cents.
Not a real good idea, though. Java -> Cocoa links are weak. You cannot do a lot of stuff in Cocoa using Java that you can with Obj-C. Also, since you're using Cocoa still for the framework - you're not gaining anything. You still have to port to a different framework on the other platform. 80% of the app is UI code anyhow....the stuff that's not UI code is standard ANSI C stuff so that's portable anyhow. The issue is how to get the UI portable as much as possible.

But...as I had thought (was just hoping maybe I had missed something), it looks like we'll just hav to write the app twice - once for OS X and once for .NET on Windows. Not that big of a deal, just...something for us to consider. It'll be Mac OS X only for a lot longer then
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Oct 13, 2003, 01:37 PM
 
If portability is your goal, then Cocoa is not a good choice for development.

Highly portable languages include Java and RealBasic. Somewhat portable languages include C or C++ with some sort of a platform-independent widget library like Qt.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Grizzled Veteran
Join Date: Aug 2002
Location: Central Texas
Status: Offline
Reply With Quote
Oct 13, 2003, 01:48 PM
 
Originally posted by Arkham_c:
If portability is your goal, then Cocoa is not a good choice for development.

Highly portable languages include Java and RealBasic. Somewhat portable languages include C or C++ with some sort of a platform-independent widget library like Qt.
No, portability is not my #1 goal.

Let me explain. For what we want to achieve, Cocoa provides the BEST way to do it on the Mac platform. There is no other real choice. We love cocoa and frankly I have little interest in providing things for Windows.

However, I know that the question will come about and so I'm looking at it early on to see if there has been any movement or experience in porting Cocoa apps to Windows with minimum fuss.

A long time ago, Yellow Box existed which took the similar API and hosted it on Windows and Next/Rhapsody/OS X. My hope was that some of the YellowBox clones like GNUStep had grown up by this point to make this an option.

So in other words, the idea is that if we can do it - then we'll do it. If not, then the Windows market will just have to suffer.

Maybe its the way I ask questions in the forums...i try to ask very specific questions and not give away all the plans we have in detail, but it seems that every time I do, I get people who try to answer what they think the REAL question is. Trust me -the only question is the one I'm asking. Sorry for being frustrated, but in the handful of questions I've asked I keep getting people second-guessing my real motives. I'm an experienced business owner and developer for a very long time, albiet in different markets and I know what questions to ask. I don't need a lecture in compatibility, or frameworks, etc.. I've developed in old world Mac Pascal Toolbox, UNIX, Win32 (non- MFC), .NET, Foundation, Carbon, and many other not so well known environments. I know all about Real Basic, Qt, etc... What we're developing *cannot* be done in Qt or RealBasic period. They require native OS controls and such. The meat of the question was just to see if there was something I missed and if not, oh well. If so - then great!
     
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Oct 13, 2003, 06:31 PM
 
It is a very good question too. I've had several requests to port my applications to Windows. Like you, I'm not particularly interested in it, and preferring Cocoa/Objective-C, it would be very difficult.

If the GNU Windows frameworks were up to scratch, or some other solution was available to make Cocoa porting to Windows an easy task, it would make a LOT of people happy!
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Oct 14, 2003, 05:20 PM
 
Quite frankly, I think this question would better be asked on a GNUstep forum than on a Mac OS X forum.

I don't mean this to be a Topic Nazi, but it's just that they would be more likely to know about using the Yellow Box APIs on Windows than people in a Macintosh Cocoa forum.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Addicted to MacNN
Join Date: Feb 2001
Location: zurich, switzerland
Status: Offline
Reply With Quote
Oct 14, 2003, 07:10 PM
 
Originally posted by alex_kac:
No, portability is not my #1 goal.

Let me explain. For what we want to achieve, Cocoa provides the BEST way to do it on the Mac platform. There is no other real choice. We love cocoa and frankly I have little interest in providing things for Windows.

However, I know that the question will come about and so I'm looking at it early on to see if there has been any movement or experience in porting Cocoa apps to Windows with minimum fuss.

A long time ago, Yellow Box existed which took the similar API and hosted it on Windows and Next/Rhapsody/OS X. My hope was that some of the YellowBox clones like GNUStep had grown up by this point to make this an option.

So in other words, the idea is that if we can do it - then we'll do it. If not, then the Windows market will just have to suffer.

Maybe its the way I ask questions in the forums...i try to ask very specific questions and not give away all the plans we have in detail, but it seems that every time I do, I get people who try to answer what they think the REAL question is. Trust me -the only question is the one I'm asking. Sorry for being frustrated, but in the handful of questions I've asked I keep getting people second-guessing my real motives. I'm an experienced business owner and developer for a very long time, albiet in different markets and I know what questions to ask. I don't need a lecture in compatibility, or frameworks, etc.. I've developed in old world Mac Pascal Toolbox, UNIX, Win32 (non- MFC), .NET, Foundation, Carbon, and many other not so well known environments. I know all about Real Basic, Qt, etc... What we're developing *cannot* be done in Qt or RealBasic period. They require native OS controls and such. The meat of the question was just to see if there was something I missed and if not, oh well. If so - then great!
I agree with you tha getting answers informing you about realbasic, Java, Qt etc can be irritating when you've already done all the work and committed to ObjC in the Cocoa frameworks. Perhaps a qualifying statement would help you in future (at the risk of getting no replies or only flames, possibly, people seem touchy sometimes).

On to your original question. I was in the comp.lang.objc for a while which I very rapidly again left because there was this absolute list Nazi called David Stes who was driving everybody insane with his mutiple posts attacking Apple for having tainted the purity of the language with the [alloc] and [init] instead of [new] statments. However the guy is fairly intelligent and created something called the portable object compiler (POC) which is a cross platform ObjC compiler and can be used on windows. Here is a link to a site with info and some basic binaries and tools for using POC on windows: http://64.191.20.46/beginlcc/
That would of course leave the Cocoa frameworks behind, which is what really is bothering you, if I understand you correctly. Moving to .Net would give you similarly powerful frameworks but no ObjC, unless you're prepared to do some lobbying activity with companies such as ActiveState or Microsoft to include it in the .Net group of languages.

Hope that helps a bit.
weird wabbit
     
   
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 07:16 PM.
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