• 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: Warnings that won't go away
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Warnings that won't go away
      • From: Sherm Pendley <email@hidden>
    • Re: Warnings that won't go away
      • From: Daniel Jalkut <email@hidden>
    • Re: Warnings that won't go away
      • From: "I. Savant" <email@hidden>
References: 
 >Warnings that won't go away (From: Tom Jones <email@hidden>)
 >Re: Warnings that won't go away (From: Sherm Pendley <email@hidden>)

  • Prev by Date: KVC keys vs acronym accessors
  • Next by Date: Re: transparent window and transparent button problems
  • Previous by thread: Re: Warnings that won't go away
  • Next by thread: Re: Warnings that won't go away
  • Index(es):
    • Date
    • Thread