On Feb 17, 2010, at 8:05 AM, Ryan Homer wrote:

> If you do reference a variable using dot notation, your accessors won't be 
> used.

I think you meant the opposite.

[...]
>> However if I assign a value with
>> 
>> [currentSection setString:@"Some value"];
> 
> Here, you've not assigned anything. If currentSection is currently nil, that 
> you are effectively doing:
> 
> [nil setString:@"Some value"]
> 
> which does nothing at all. You probably meant to do something like this:
> 
> self.currentSection = [NSString string]; // allocate the memory for the string

You have to use NSMutableString if you're going to mutate it.

> [self.currentSection setString:@"Some value"]; // set the string to the 
> allocated memory

Regards,
Ken

_______________________________________________

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