• 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: Datasource for tableview and more
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Datasource for tableview and more


  • Subject: Re: Datasource for tableview and more
  • From: Jim Correia <email@hidden>
  • Date: Sun, 2 Sep 2001 10:36:54 -0400

At 12:58 AM -0400 9/2/01, Brendan Younger wrote:

The first one. Any method with a "+" preceding it means that it returns
a completely new object. A method with a "-" sign means that if you
already have an object, you can call upon it to execute that method.

[snip]

Declaring methods with "+" or "-" only tells the compiler and users of
the class which methods create new instances and which methods are
performed only by specific instances of the class. The tacit assumption
is that you implement these methods to do what the "+" or "-" sign
implies.


That is incorrect.

+ is a class method. - is an instance method. Nothing more. Nothing less.

I don't know where you got the misconception that + methods return a new object.

Given the class Foobar, you could write

+ (void)doSomethingUseful;

[Foobar doSomethingUseful];


It is nice to be helpful and to want to give people advice. However, you should make sure you are giving them correct advice, or they will end up worse off than they started. Ondra's advice, while possibly curt, does lead one to the correct answer. Understanding the difference between class an instance methods is an important concept that one needs to understand correctly, not in some hand waving incorrect + methods return new objects way.

Jim


  • Follow-Ups:
    • Re: Datasource for tableview and more
      • From: Brendan Younger <email@hidden>
References: 
 >Re: Datasource for tableview and more (From: Brendan Younger <email@hidden>)

  • Prev by Date: Re: The unquittable App
  • Next by Date: NXAtom
  • Previous by thread: Re: Datasource for tableview and more
  • Next by thread: Re: Datasource for tableview and more
  • Index(es):
    • Date
    • Thread