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

Re: NSString initWithCharactersNoCopy


  • Subject: Re: NSString initWithCharactersNoCopy
  • From: Shawn Erickson <email@hidden>
  • Date: Fri, 11 Jun 2004 14:46:42 -0700

On Jun 11, 2004, at 12:21 PM, John Stiles wrote:

I'm looking at the following NSString prototype:
- (id)initWithCharactersNoCopy:(unichar *)characters
length:(unsigned)length freeWhenDone:(BOOL)flag

And wondering why characters is a unichar* and not a const unichar*.
Can this call really modify the buffer? I'm not making an
NSMutableString...

Note the "freeWhenDone:" part of that method. It will free the buffer you pass in at some future date if you pass in YES. I assume that is why.

-Shawn
_______________________________________________
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.


References: 
 >NSString initWithCharactersNoCopy (From: John Stiles <email@hidden>)

  • Prev by Date: NSString initWithCharactersNoCopy
  • Next by Date: Re: Rasterizing an NSString to a bitmap
  • Previous by thread: NSString initWithCharactersNoCopy
  • Next by thread: Re-Initializing (clearing) a NSTextView object
  • Index(es):
    • Date
    • Thread