• 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: Learning Cocoa/ObjectiveC and wondering why I had to do this.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Learning Cocoa/ObjectiveC and wondering why I had to do this.


  • Subject: Re: Learning Cocoa/ObjectiveC and wondering why I had to do this.
  • From: j o a r <email@hidden>
  • Date: Mon, 7 Mar 2005 00:09:28 +0100


On 2005-03-06, at 23.20, Tom Boucher wrote:

Can you translate this for me?
NSString *result = [NSString stringWithFormat:@"%@ has %u letters.",string,letterCount];

You're calling the "stringWithFormat:" method on "NSString", ie. the class object for the NSString class. The reason that the class object is the receiver, is because this is a class method, and not an instance method. Read the ObjC PDF for more info.


j o a r

_______________________________________________
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


References: 
 >Learning Cocoa/ObjectiveC and wondering why I had to do this. (From: Tom Boucher <email@hidden>)

  • Prev by Date: Re: Learning Cocoa/ObjectiveC and wondering why I had to do this.
  • Next by Date: Re: -[NSSet initWithSet:copyItems:] crashing
  • Previous by thread: Re: Learning Cocoa/ObjectiveC and wondering why I had to do this.
  • Next by thread: Re: Learning Cocoa/ObjectiveC and wondering why I had to do this.
  • Index(es):
    • Date
    • Thread