• 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
Better database/spreadsheet model (aka not nsarray)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Better database/spreadsheet model (aka not nsarray)


  • Subject: Better database/spreadsheet model (aka not nsarray)
  • From: Francisco Tolmasky <email@hidden>
  • Date: Wed, 26 Mar 2003 00:09:37 -0800

This is kind of a vague question, but here goes...

I'm working on a program that has some spreadsheet-like qualities. People can create rows and columns and store values. They can move columns around (not rows) and sort by column, as well as change the values for the cells. It's basically an nstablview. I have also implemented a real time search like iTunes. The only problem is that my model, or actual storage class, that I use has become too cumbersome. Does anyone here know where I can find a good example of a good storage method. Or does anybody know of any good methods?

I mainly run into problems that I have to solve quite sloppily when I add/delete, remove with real time searches, etc. I can't just use an NSArray of NSArrays because of this. Currently I have something like

@class row
{
int index;
sting *info;
//some more stuff.
}

An NSmutablearray filled with these rows. and another filled with the visible ones (this array is purged later on when the real time search is in action)

Then i have something like

@class column
{
nsmutablearray values;
}

where I have values stored in each rows index, like this
values [objectAtIndex: [someRow index]];

that way when my rows become sorted they still refer to the same actual space in the "database". Also, when I purge my rows for non-searched values, they still refer correctly.

The problem is, when I delete a row, I have to go through all the other rows reducing the index by one.

And many more problems with sloppy solutions.

Does anybody know of a more elegant way to do all this? Sorry if my description was a little vague.

Any help is greatly appreciated.

Francisco Tolmasky
email@hidden
http://users.adelphia.net/~ftolmasky
_______________________________________________
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.

  • Prev by Date: Re: 1/2OT] CVS gui client for X
  • Next by Date: Re: 1/2OT] CVS gui client for X
  • Previous by thread: Re: [ 1/2OT] CVS gui client for X - Results of the poll
  • Next by thread: To someone at Apple
  • Index(es):
    • Date
    • Thread