• 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: NSString accessing characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString accessing characters


  • Subject: Re: NSString accessing characters
  • From: Ken Thomases <email@hidden>
  • Date: Sat, 18 Jun 2011 05:34:05 -0500

On Jun 17, 2011, at 5:35 AM, Andreas Grosam wrote:

> Thank you Ken, for your valuable tips,

You're welcome.

> On Jun 17, 2011, at 10:40 AM, Ken Thomases wrote:
>
>> After that, maybe use CFStringInitInlineBuffer() and CFStringGetCharacterFromInlineBuffer(), although that doesn't fit with your iterator interface.  You could wrap an iterator around them easily, though.

> I don't understand the purpose of the "inline buffer" facility fully, though. Is accessing a NSString's content through an inline buffer faster than accessing the content of a raw pointer whose content has a known encoding?

No.  The inline buffer would be slower than either of the Get...Ptr functions.  However, it is an optimized way of doing a conversion, as would be required when the Get...Ptr functions return NULL.  It converts in chunks and preserves state between chunks so that conversion of the next chunk can resume without recomputing state.  Also, it uses a fixed-size stack buffer, avoiding heap allocation.

Regards,
Ken

_______________________________________________

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: 
 >NSString accessing characters (From: Andreas Grosam <email@hidden>)
 >Re: NSString accessing characters (From: Ken Thomases <email@hidden>)
 >Re: NSString accessing characters (From: Andreas Grosam <email@hidden>)

  • Prev by Date: Drawing focus rings
  • Next by Date: Re: Writing extremely large RTF or .doc files
  • Previous by thread: Re: NSString accessing characters
  • Next by thread: Re: NSString accessing characters
  • Index(es):
    • Date
    • Thread