• 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: NSObject Exercise comments?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSObject Exercise comments?


  • Subject: Re: NSObject Exercise comments?
  • From: Andy Lee <email@hidden>
  • Date: Mon, 12 Dec 2005 14:53:01 -0500

On Dec 12, 2005, at 2:04 PM, John Stiles wrote:
On Dec 10, 2005, at 10:39 AM, Andreas Mayer wrote:
I know that there was a convention were the original object was returned when ever possible, so that one could 'chain' method calls together. But I think this is discouraged now. At least it's uncommon and therefore confusing.

Is that so? I thought that was one of the coolest points of Cocoa, honestly. You certainly still see it throughout Apple's classes.

Is that true? Back in the early NextStep days all methods implicitly returned self if you didn't return something explicitly, the way Smalltalk does. (Probably that should be "all methods with id return values.") I thought that default behavior was removed from Objective- C as a language feature -- but never thought to check whether people still did it as a matter of convention. I always thought no, methods either return a specific thing or have void as a return type -- they don't return self as a fallback.

--Andy

_______________________________________________
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: NSObject Exercise comments?
      • From: Ondra Cada <email@hidden>
References: 
 >Re: NSObject Exercise comments? (From: Lee Cullens <email@hidden>)
 >Re: NSObject Exercise comments? (From: Andreas Mayer <email@hidden>)
 >Re: NSObject Exercise comments? (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Cocoa and REALbasic communication?
  • Next by Date: Re: Cocoa and REALbasic communication?
  • Previous by thread: Re: NSObject Exercise comments?
  • Next by thread: Re: NSObject Exercise comments?
  • Index(es):
    • Date
    • Thread