• 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: ARC question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ARC question


  • Subject: Re: ARC question
  • From: BobCromwell <email@hidden>
  • Date: Mon, 29 Oct 2012 19:41:53 +0800

Every assignment will release the old one,so no leak.

From My iPhone

在 2012-10-29,下午7:34,Mike Abdullah <email@hidden> 写道:

>
> On 29 Oct 2012, at 10:06, Vincent Habchi <email@hidden> wrote:
>
>> Hi folks,
>>
>> before aught else, all my thoughts to those of you in the Eastern coast that are preparing themselves for a bunch of bleak days…
>>
>> I’ve just a silly question (I know, I don’t post very often and I apologize for that): I need to convert a HTML style string, with “& escapes” to normal UTF-8. So I wrote this:
>>
>> -(NSString *)convertHTMLtoUTF8:(NSString *)aString {
>>
>>    NSString * convertedString = [aString copy];
>>    for (NSString * pattern in [HTMLtoUTF keyEnumerator]) {
>>        convertedString = [convertedString stringByReplacingOccurrencesOfString:pattern
>>                                         withString:HTMLtoUTF [pattern]];
>>    }
>>
>>    return convertedString;
>> }
>>
>> where HTMLtoUTF is a dictionary of pairs {@"&…;" : @"<corresponding_UTF8_char>"}.
>>
>> Now, my question is: is that scheme going to work correctly with ARC? Is it not going to leak each intermediate version of ‘convertedString’?
>
> The code is a fairly inefficient to start with, but no, it's not going to leak.
>
>
> _______________________________________________
>
> 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: 
 >ARC question (From: Vincent Habchi <email@hidden>)
 >Re: ARC question (From: Mike Abdullah <email@hidden>)

  • Prev by Date: Getting rid of primitive accessor warnings
  • Next by Date: Re: Drawing customized window
  • Previous by thread: Re: ARC question
  • Next by thread: how to clip inside a path
  • Index(es):
    • Date
    • Thread