• 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: HTML-encoded characters mucking up my NSStrings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTML-encoded characters mucking up my NSStrings


  • Subject: Re: HTML-encoded characters mucking up my NSStrings
  • From: Dustin Voss <email@hidden>
  • Date: Tue, 10 Feb 2004 17:58:12 -0800

On 10 Feb, 2004, at 4:15 PM, Kyle Moffett wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Feb 10, 2004, at 18:22, Dustin Voss wrote:
CFStringRef unescapedCF = CFXMLCreateStringByUnescapingEntities (NULL, (CFStringRef) htmlString, NULL);
NSString *unescaped = [NSString stringWithString: (NSString *) unescapedCF];
CFRelease (unescapedCF);

Why bother with the extra string? CFStringRef and NSString * are Toll-Free bridged

NSString *noEntities = (NSString *)CFXMLCreateStringByUnescapingEntities (NULL, (CFStringRef)withEntities, NULL);

Note, noEntities is *not* autoreleased, you need to autorelease or release it when done.

You are right, of course, but I don't like the idea of calling "retain", "release", or "autorelease" on CF references, even if they are toll-free bridged. There might be zones or something that screws that up. Or maybe I'm just overly paranoid... :)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: HTML-encoded characters mucking up my NSStrings
      • From: Kyle Moffett <email@hidden>
References: 
 >HTML-encoded characters mucking up my NSStrings (From: Tom Burns <email@hidden>)
 >Re: HTML-encoded characters mucking up my NSStrings (From: Dustin Voss <email@hidden>)
 >Re: HTML-encoded characters mucking up my NSStrings (From: Kyle Moffett <email@hidden>)

  • Prev by Date: Re: Create an image Browser.
  • Next by Date: Re: Jaguar NSImage caching woes roundup
  • Previous by thread: Re: HTML-encoded characters mucking up my NSStrings
  • Next by thread: Re: HTML-encoded characters mucking up my NSStrings
  • Index(es):
    • Date
    • Thread