Re: incompatible pointer type warning, but everything OK?
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