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: Ron Fleckner <email@hidden>
- Date: Tue, 16 May 2006 16:08:26 +1000
On 16/05/2006, at 1:47 PM, Nick Zitzmann wrote:
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/>
Bingo! Yes I'd neglected to import the class' header into my
controllers .m file. That fixed it.
Thanks Nick.
Ron Fleckner
_______________________________________________
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