tags:

views:

112

answers:

1

I have a medical app for the iPhone that I'm working on, where a user creates timestamped entries for a series of tests performed, which are stored in sqlite for retrieval and subsequent drilldown. In my model class, I have a property uses an NSArray that is populated with these entries, which gets updated as new additions are made in the app.

One thing I'd like to do is display UI behavior similiar to what the Calendar list view does - for any given day, display a section header, that show the name of the day and the date, ans display the entries made for that day.

From a brute force standpoint, I can see how you could precalculate this - as build your list of entries, you could store the entire list in a dictionary, keyed by date.

This seems pretty inelegant though, so I'm wondering if there are other more efficient ways to accomplish this task.

A: 

If Core Data WERE available on the iPhone, you could store your information that way instead of sqlite.

Then, when you wanted data for particular day you could search using NSPredicate with a sort descriptor.

Core Data will then return the relevant data sorted according to your descriptor. Nice and neat.

Maybe visit the Apple Dev Center/Forums for some more info on upcoming software...

Corey Floyd