• 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: create NSMutableString with no limit?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: create NSMutableString with no limit?


  • Subject: Re: create NSMutableString with no limit?
  • From: j o a r <email@hidden>
  • Date: Sat, 18 Mar 2006 23:45:47 +0100


On 18 mar 2006, at 23.37, James W. Walker wrote:

What's the right way to create an NSMutableString with no limit on its capacity? The only initialization method listed in the docs is initWithCapacity, and it doesn't say you can pass 0 as the capacity. I can take advantage of toll-free bridging and say (NSMutableString*)CFStringCreateMutable( NULL, 0 ), but there must be a more obvious way.

Interestingly enough NS and CF works completely differently with regards to this! If you specify a capacity for one of the mutable classes in NS, this acts as a "hint", while if you do the same thing in CF it will act as a max limit!


Personally I don't think that the way it works in CF makes a whole lot of sense. When would you ever be interested in a fixed limit for a mutable collection, implemented in the collection class and not the controller?

So, to answer your question - NS classes will never have a capacity limit (besides the obvious ones, like memory availability and addressing limitations), regardless of how you instantiate them.

j o a r


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: create NSMutableString with no limit?
      • From: Andy Lee <email@hidden>
References: 
 >create NSMutableString with no limit? (From: "James W. Walker" <email@hidden>)

  • Prev by Date: create NSMutableString with no limit?
  • Next by Date: Re: create NSMutableString with no limit?
  • Previous by thread: create NSMutableString with no limit?
  • Next by thread: Re: create NSMutableString with no limit?
  • Index(es):
    • Date
    • Thread