On Thu, May 28, 2009 at 4:57 PM, John Ku <john.c...@gmail.com> wrote:
> NSString *title = [[NSString alloc] init];
> title = @"TEST";

NSString is immutable, and Objective-C doesn't have operator
overloading.  So what you're doing here is creating an empty NSString,
assigning a pointer to it to your title variable, then immediately
assigning a different pointer-to-NSString-constant to the same
variable.  = always does assignment in Objective-C; it never means
"tell this object to change its value to what's on the right side of
the equals sign."

--Kyle Sluder
_______________________________________________

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