• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Synthesize NSMutableString retain count question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Synthesize NSMutableString retain count question (From: Philip Vallone <email@hidden>)

  • Prev by Date: Synthesize NSMutableString retain count question
  • Next by Date: Help with NSData dataWithContentsOfURL
  • Previous by thread: Synthesize NSMutableString retain count question
  • Next by thread: Re: Synthesize NSMutableString retain count question
  • Index(es):
    • Date
    • Thread