Re: Warnings that won't go away
Re: Warnings that won't go away
- Subject: Re: Warnings that won't go away
- From: "I. Savant" <email@hidden>
- Date: Wed, 30 Nov 2005 09:04:42 -0500
Tom:
This may help: http://developer.apple.com/documentation/Cocoa/
Conceptual/ObjectiveC/index.html
This as well: http://www.amazon.com/gp/product/0672325861/
qid=1133359438/sr=8-1/ref=pd_bbs_1/002-9571839-5124069?
n=507846&s=books&v=glance
Finally:
http://www.google.com/
--
I.S.
On Nov 30, 2005, at 8:07 AM, Tom Jones wrote:
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:
40gmail.com
This email sent to email@hidden
_______________________________________________
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