• 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: Display csv in a tableView with bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Display csv in a tableView with bindings


  • Subject: Re: Display csv in a tableView with bindings
  • From: "Adam R. Maxwell" <email@hidden>
  • Date: Sun, 26 Jul 2009 14:52:20 -0700


On Jul 26, 2009, at 2:38 PM, I. Savant wrote:

On Jul 26, 2009, at 3:52 PM, Aaron Burghardt wrote:

Not necessarily. If the keys are NSStrings, then they are copied when added to the dictionary, but a copy of an immutable string is optimized to just retain it, so the data isn't duplicated (assuming all rows have the same columns in the same order, an assumption you don't seem to be making).

Actually, I temporarily take back my "you're probably right" response. :-) I can't find a reference to this anywhere, but I admittedly only looked in the NSString API reference, the Introduction to Strings Programming Guide for Core Foundation and quickly perused the The Objective-C 2.0 Programming Language.

Would you mind directing me to where this is stated? I'm not saying you're wrong - it sounds plausible - I'm just not sure you're right. :-)

"CFString objects perform other “tricks” to conserve memory, such as incrementing the reference count when a CFString is copied."


http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFStrings/Articles/StringStorage.html#//apple_ref/doc/uid/20001179


It's not unreasonable, and we don't know the OP's performance requirements.


No, it's not unreasonable, but since we don't know the OP's performance requirements, the original blanket statement that NSDictionary is better won't do without these caveats (ie, "it's easier for bindings, but dog-slow on reasonably large files"). Rather than just say "there's more to it than that" as a drive-by correction, I wanted to provide a helpful explanation and workaround, since this is an area in which I have recent and detailed experience. :-)

"Reasonably large files" is reasonably vague :). We have an application that keeps an array of bibliographic references, where each is an NSMutableDictionary with other properties. The largest file I recall throwing at it is ~20K items, and the main problem at that point was a beachball when using SearchKit...which was a nuisance to work around. It doesn't use bindings, but there really aren't any lazy loading tricks either.



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

_______________________________________________

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

  • Follow-Ups:
    • Re: Display csv in a tableView with bindings
      • From: Kyle Sluder <email@hidden>
    • Re: Display csv in a tableView with bindings
      • From: "I. Savant" <email@hidden>
References: 
 >Display csv in a tableView with bindings (From: email@hidden)
 >Re: Display csv in a tableView with bindings (From: Aaron Burghardt <email@hidden>)
 >Re: Display csv in a tableView with bindings (From: "I. Savant" <email@hidden>)
 >Re: Display csv in a tableView with bindings (From: Aaron Burghardt <email@hidden>)
 >Re: Display csv in a tableView with bindings (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: Using Snow Leopard for development (was: NSString Retain Count of 2147483647)
  • Next by Date: Re: Display csv in a tableView with bindings
  • Previous by thread: Re: Display csv in a tableView with bindings
  • Next by thread: Re: Display csv in a tableView with bindings
  • Index(es):
    • Date
    • Thread