Re: Warnings that won't go away
Re: Warnings that won't go away
- Subject: Re: Warnings that won't go away
- From: Tom Jones <email@hidden>
- Date: Wed, 30 Nov 2005 07:07:42 -0600
Thanks,
The problem was that I was not including the header file (Playlist.h).
Which leads to my next newbie question. What's the difference between
the @class directive and the #import directive...when should I use one
and not the other? I was using @class, and getting warnings. Do I need
to use #import when I am calling specific methods of my class, and use
@class when I want to instantiate a member variable of a particular
class?
Thanks again,
Tom
On 11/30/05, Sherm Pendley <email@hidden> wrote:
> On Nov 30, 2005, at 1:52 AM, Tom Jones wrote:
>
> > Here's some code from MyDocument.m
> > [[self playlist] insertObject:theItem inPlaylistItemsAtIndex: [[self
> > playlist] countOfPlaylistItems]];
> >
> > I get two warnings on this line:
> > warning: no '-countOfPlaylistItems' method found
> > warning: no '-insertObject:inPlaylistItemsAtIndex:' method found
> >
> > The code executes correctly, but how do I get rid of the warnings?
>
> Declare -playlist as returning an instance of the class that
> implements those methods, instead of an id.
>
> -or-
>
> Typecast the return value by using "(SomeClass*)[self playlist]" in
> place of "[self playlist]".
>
> -or-
>
> Add declarations (but not implementations) of these methods as a
> category of NSObject.
>
> sherm--
>
> Cocoa programming in Perl: http://camelbones.sourceforge.net
> Hire me! My resume: http://www.dot-app.org
>
>
_______________________________________________
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