Re: Synthesize NSMutableString retain count question
Re: Synthesize NSMutableString retain count question
- Subject: Re: Synthesize NSMutableString retain count question
- From: Alexander Spohr <email@hidden>
- Date: Wed, 3 Feb 2010 15:06:32 +0100
> currentSection = @"Some value";
has nothing to do with
> [currentSection setString:@"Some value"];
The first sets currentSection to a string, the second sets the content of currentSection.
a) In the second line you just set the content but you never assigned an NSMutableString to currentSection before. Therefore the call is ignored and currentSection itself stays nil.
b) The first line should throw a warning as @"Some value" is not mutable. It is an error.
atze
Am 03.02.2010 um 12:55 schrieb Philip Vallone:
> Hi List,
>
> This is probably a very elementary question. I have a NSMutableString that I Synthesize. When I assigned a value to it:
>
> currentSection = @"Some value";
>
> The retain count goes to 1
>
> However if I assign a value with
>
> [currentSection setString:@"Some value"];
>
> The retain count is still zero.
>
> Can someone explain the difference?
>
> Thanks,
>
> Phil
>
>
> _______________________________________________
>
> 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
_______________________________________________
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