On May 28, 2013, at 6:39 AM, Alex Zavatone <z...@mac.com> wrote:

> NSString *myString;

You’ve declared myString as a _mutable_ pointer to an _immutable_ object. If 
you had declared it as

        NSString* const myString = @“Hi";

then the variable itself would be immutable, and the compiler would give you an 
error if you tried to reassign it. (You often see this style used when 
declaring a string constant in a header file, since it’s supposed to stay 
constant and no one should reassign it.)

Working with C++ will beat this concept into your head (for better or worse).

—Jens
_______________________________________________

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

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

Reply via email to