• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
using C++ with Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: using C++ with Cocoa
      • From: Oscar Morales Vivo <email@hidden>
  • Prev by Date: File packages and Activity Monitor - all files opening regardless
  • Next by Date: Re: using C++ with Cocoa
  • Previous by thread: File packages and Activity Monitor - all files opening regardless
  • Next by thread: Re: using C++ with Cocoa
  • Index(es):
    • Date
    • Thread