Re: Decoding a line of Objective-C
Re: Decoding a line of Objective-C
- Subject: Re: Decoding a line of Objective-C
- From: Steve Bird <email@hidden>
- Date: Sun, 8 Jul 2007 16:37:20 -0400
On Jul 8, 2007, at 4:23 PM, Kevin Walzer wrote:
I understand what this line signifies:
MyClass *MCLSSharedInstance;
*MCLSSShareInstance is a pointer to an instance variable of MyClass.
However, I am a bit confused by this line:
+ (MyClass *)sharedInstance
I understand that "sharedInstance" is a class method of MyClass,
but what does the asterisk refer to? What is the pointer here?
Could this be also be written as
+ MyClass *sharedInstance
?
--- The parentheses signify that this is the data type of the
returned value.
Without the parentheses, it looks like an instance variable (in which
case the "+" is wrong).
----------------------------------------------------------------
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden