• 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: incompatible pointer type warning, but everything OK?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: incompatible pointer type warning, but everything OK?


  • Subject: Re: incompatible pointer type warning, but everything OK?
  • From: Nick Zitzmann <email@hidden>
  • Date: Mon, 15 May 2006 21:47:46 -0600


On May 15, 2006, at 9:10 PM, Ron Fleckner wrote:

I'm adding a subview to my main window's contentView, and when I do, Xcode warns that I'm 'passing argument 1 of 'addSubview:' from incompatible pointer type'. The argument is a pointer to an instance of a subclass of NSView, and when I run the app it works. The user clicks a disclosure triangle at the bottom of the window and the window resizes and the new view is added, but the warning still remains in Xcode.

I note that in the docs it says that addSubview expects an instance of NSView, but my view is a subclass. I thought it should work to pass a subclass, and it does, so why the warning?

Are you importing the class' header file, or did you use an @class declaration to make the compiler know about the class? Usually, when you see this warning, it means you're doing the latter when you should probably be doing both.


Nick Zitzmann
<http://www.chronosnet.com/>




_______________________________________________ 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
  • Follow-Ups:
    • Re: incompatible pointer type warning, but everything OK?
      • From: Ron Fleckner <email@hidden>
References: 
 >incompatible pointer type warning, but everything OK? (From: Ron Fleckner <email@hidden>)

  • Prev by Date: Re: Do I need to release static "class" variables?
  • Next by Date: Re: What's so special about NSString literals? (RE: memory management)
  • Previous by thread: incompatible pointer type warning, but everything OK?
  • Next by thread: Re: incompatible pointer type warning, but everything OK?
  • Index(es):
    • Date
    • Thread