using C++ with Cocoa
using C++ with Cocoa
- Subject: using C++ with Cocoa
- From: Frank Weinstock <email@hidden>
- Date: Thu, 24 May 2007 09:25:52 -0400
I have a Cocoa project going and, for various reasons, need to add a
number of C++ class (and I'm a newbie with C++). Those classes need
to refer to Cocoa objects, which of course come in the form of
pointers. But when I use pointers as data members in C++, Xcode
gives me the warning (actually 3 warnings): "class ClassName has
pointer data members but does not override 'ClassName(const
ClassName&)' or 'operator= (const ClassName&)' " (where ClassName is,
of course, the class I am defining). I know how to override ClassName
(const ClassName&), but I have no idea how to override operator=
(const ClassName&)', or what that even means in this context.
I know the whole thing could be avoided by using C++ references
instead of pointers, but in this case I can't do that because the
data is not available when the class is first created. Also, I know
that warnings are not the end of the world, but I'd rather get rid of
them if possible...
Thanks for any ideas!
Best,
Frank
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden