Re: NewCommer -win32 to cocoa
Re: NewCommer -win32 to cocoa
- Subject: Re: NewCommer -win32 to cocoa
- From: "Alastair J.Houghton" <email@hidden>
- Date: Fri, 24 Oct 2003 10:19:19 +0100
On Friday, October 24, 2003, at 09:32 am, Waseem Ashraf wrote:
Hi,
I started learning cocoa this week, as in our office we need to
rewrite our
win32 application for mac users.
I want to know how can I use my c++ classes, which uses a lot virtual
functions, in cocoa application. Secondly can I pass the objective c
class
inherited from view to my c++ classes as a parameter.
Have you got any other thoughts as i don't want to rewrite my c++
classes in
objective c.
You don't have to. Just use Objective C++ (i.e. use the extension
".mm" rather than ".m") and you can mix C++ and Objective C code to
your heart's content. There are a few gotchas, for example, Objective
C exceptions won't unwind the stack the way C++ exceptions do
(specifically, C++ destructors won't run when Objective C raises an
exception), but as long as you make sure that Objective C exceptions
don't propagate through/out of C++ functions, you'll be fine.
There are a number of portability problems you will very likely come up
against when porting code from Win32 to other platforms, ranging from
your code not being C++ standard compliant through use of Win32 or
MSVC-specific types to things like byte ordering assumptions.
Depending on your timescale and expectations, it might make more sense
to hire someone with experience of both platforms (and of code
portability problems) to do your port for you. It probably isn't a
good idea to try to learn Cocoa and then immediately jump in to porting
a complex piece of pre-existing software.
Kind regards,
Alastair.
_______________________________________________
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.