NSString is the class. myString is an instance of that class and in this case 
is a variable. myString is information. Its not an operation. It is a class 
instance which contains information on what the data is and what can be done 
with it. 

mystring is not a function. copy is a method call to that instance of a class.

On Jul 24, 2011, at 10:01 PM, Tom Jeffries wrote:

> On Sun, Jul 24, 2011 at 12:12 PM, Andy Lee <ag...@mac.com> wrote:
> 
>> You should know that it is most certainly possible to use that syntax with
>> a variable. For example:
>> 
>>   NSString *myString = @"abc";  // <== a variable
>>   NSString *newString = [myString copy];  // <== a message send
>> 
>> You can send messages to both classes and instances of classes. If you are
>> not clear about the difference between a class and an instance, let us know
>> now so we can proceed on the same page.
>> 
> 
> 
> OK, we're each half right- myString in this case is a function, not a class,
> but I would question calling it a variable.  Maybe I'm old fashioned, but I
> think it's important to distinguish between information (variables) and
> operations (functions).  That is one reason why I'm less than completely
> enthusiastic about Objective C syntax and Cocoa conventions.  However, I do
> understand that using them would make it easier to understand what's going
> on.
> 
> I've gotten several interesting hints from the comments, which I appreciate.
> I'm going to pursue them, if I don't find a solution I'll see if I can post
> a more understandable example.
> 
> Thanks, Tom
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/alex%40webis.net
> 
> This email sent to a...@webis.net

Alex Kac - President and Founder
Web Information Solutions, Inc. 

"If at first you don't succeed, skydiving is not for you."
-- Francis Roberts





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to