Re: Cocoa/Windows parallel dvlpmt
Re: Cocoa/Windows parallel dvlpmt
- Subject: Re: Cocoa/Windows parallel dvlpmt
- From: Darrin Cardani <email@hidden>
- Date: Sat, 31 Jan 2004 17:52:03 -0600
At 1:11 PM -0800 1/31/04, Erez Anzel <email@hidden> wrote:
I have been happily developing in Cocoa using XCode 1.1. But I have to
port to Windows, very quickly. ...
I know almost nothing of Windows, MFC, Visual C++, etc. I have no idea
how (or if) they implement multiple Undo, for instance. I have never
touched Windows, and don't have a Windows machine; I figure I'd start
with Virtual PC for Mac.
Please don't take this as an insult, but from the above description,
it sounds like you're potentially setting yourself up for failure.
What you want to do can certainly be done, but it sounds like you
don't know enough about Windows to even know where to begin, let
alone get it done quickly. I wonder if you might be better off
finding a Windows developer and splitting the profits of the Windows
version with him/her. Or maybe help them port their Windows app to
the Mac in exchange, or something.
To be sure, you can do real Windows development on Virtual PC. I
currently write high end video editing plugins that work on both Mac
OS and Windows using CodeWarrior on the Mac. I compile the Windows
version on one Mac and debug using the Mac/Windows cross debugger
with Virtual PC running on another Mac. However, I need very little
in the way of user interface for my plugins, as the host application
handles most of that for me, so it's probably easier for me than it
will be for you, since it sounds like your app will be UI intensive.
(The price of a cheap no-name PC is not too much more than the price
of Virtual PC, but you do have to factor in the additional space,
electricity, etc. you'll end up using, too.)
I am not sure if I should have two separate models (in the MVC sense).
In Cocoa I could use NSMutableArray, and each of my objects could be an
NSObject subclass, which is what I have now. In Windows I'd have some
parallel.
I'm working on another project in Cocoa that is currently Mac-only,
but the customer has started thinking about doing a Windows port.
What I've done is written the model objects in C++ using Core
Foundations for most of my containers and to handle Unicode text. As
I understand it, you can get the source to much of Core Foundations
from Darwin and compile it for x86. I haven't tried this yet, so I
don't know for sure if it will work, but I'm looking into it. It
works nicely with Cocoa because CFStrings, CFArrays, and
CFDictionaries use the "toll-free bridge" with NSStrings, NSArrays,
and NSDictionaries. So my C++ code can store an array of strings, and
the Obj-C code can directly use those objects. On the Windows side,
I'll have to do some conversion when I need to pass the resulting
string to an OS routine, but that's not too difficult.
Or should I use STL lists or vectors, and then in Cocoa have
a model object which owns the STL list of raw C++ objects, and do
likewise in Windows.
As I understand it, you can't use STL in Cocoa code. If nothing else,
you'll have problems with templates because of the "<>" bracket
syntax, if I recall correctly.
For actions upon my objects, I'd perhaps use some
Objective-C wrapper in Cocoa as I operate on each individual object.
That might, however, be very inefficient.
That could work. Or you could have your (model) objects be C++
objects and use them directly in both Cocoa and MFC. You can pretty
easily mix Obj-C and C++, so long as you follow the few rules that
Apple outlines in their description of how to do it. (You need to
understand that destructors won't get called for stack-based C++
objects in Objective-C, so you need to always allocate and delete C++
objects in the heap, for example.) You can find more in the developer
docs that get installed with XCode in /Developer/Documentation/.
(Sorry, I can't find the exact path at the moment.)
Any pointers, guidance, etc. would be greatly appreciated. When I have
more cash, I'll hire someone who knows what they're doing.
Well, just be sure you get to the point where you get more cash. :-)
It takes a lot of hard work to launch a product successfully on one
platform, let alone 2. Good luck!
Darrin
--
Darrin Cardani - email@hidden
President, Buena Software, Inc.
<
http://www.buena.com/>
Video, Image and Audio Processing Development
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.