• 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
Re: warning: C++ constructors and destructors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: warning: C++ constructors and destructors


  • Subject: Re: warning: C++ constructors and destructors
  • From: "E. Wing" <email@hidden>
  • Date: Wed, 15 Feb 2006 16:52:57 -0800

If you can target Tiger/gcc 4.0, another way of dealing with this is
to invoke the gcc flag:
-fobjc-call-cxx-cdtors
Look for "Call C++ Default Ctors/Dtors in Objective-C" in your Xcode
build settings. It's description is:
Run non-trivial default constructors and destructors on C++ instance
variables of Objective-C classes.

-Eric


> From: John Stiles <email@hidden>
>
> Actually, be sure to call delete in your -dealloc method.
> Don't free objects created by new.  It may leak or corrupt the heap,
> and destructors will not be called.
>
> On Feb 15, 2006, at 1:09 PM, Tim Hart wrote:
>
> > Simon,
> >
> > Declare your instance variables to C++ classes as pointers to
> > instances instead. Then, in your init method, call 'new' as
> > appropriate. Be sure to call 'free' in your '-dealloc' method. That
> > will quiet the warnings.
> >
> > Tim
> >
> > On Wednesday, February 15, 2006, at 03:03PM, Simon Brée
> > <email@hidden> wrote:
> >
> >> Hi All,
> >>
> >> I've got this warnings when compiling :
> >>
> >> /Users/simon/Projets/Magnéto/SBObject/SBAudioFile.h:30: warning: type
> >> `CAStreamBasicDescription' has a user-defined constructor
> >> /Users/simon/Projets/Magnéto/SBObject/SBAudioFile.h:30: warning: C++
> >> constructors and destructors will not be invoked for Objective-C
> >> fields
> >>
> >> My application works anyway, but does anyone know how to solve it?
> >>
> >> Thanks,
> >>
> >> Simon
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Cross-platform?
  • Next by Date: Re: plain white boxes/views
  • Previous by thread: Re: warning: C++ constructors and destructors
  • Next by thread: Re: warning: C++ constructors and destructors
  • Index(es):
    • Date
    • Thread