• 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
Faking large arrays in bindings to satisfy sparse data...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Faking large arrays in bindings to satisfy sparse data...


  • Subject: Faking large arrays in bindings to satisfy sparse data...
  • From: アンドレ(Andre) <email@hidden>
  • Date: Sat, 19 Mar 2005 18:01:56 -0800

Hi,

I'm currently working on a project that uses bindings for structured data that may get very large.
In order to deal with this I have devised a class that encapsulates a sparse array.
The only problem is that even though it contains a to-many relation with its contents,
when binding to an array controller, I am wondering if I can fake the count of objects...


For example, say I only have two items in my sparse array, but the second item is in position 33.
If I have my object return countOf<Key> to return 33 would that be good enough?
When the controller gets a change to another position below 33 I could handle it and
abstract it with objectIn<Key>AtIndex: etc, but what I am worried about is anything above
33.... what would happen if I returned INT_MAX for countOf<key> would that cause the
NSArrayController to allocate space for 2 billion items?? Or is it smart enough?


Is there any way to do this besides getting all the items in a given array, iterate their "position" key
to find the ones I want changed or removed??


I thought about an NSDictionary, but this has speed disadvantages as each key must be compared in unicode
when all I need is to compare numerals (positions in the sparse array)....


I really want to use bindings!!

Please let me know if anyone has an idea.
I appreciate it.
_______________________________________________
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: Faking large arrays in bindings to satisfy sparse data...
      • From: Marco Scheurer <email@hidden>
    • Re: Faking large arrays in bindings to satisfy sparse data...
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: NSTask as root
  • Next by Date: drag image out of NSTextView
  • Previous by thread: Lost on a one way street
  • Next by thread: Re: Faking large arrays in bindings to satisfy sparse data...
  • Index(es):
    • Date
    • Thread