The iPhone Notes DB - Terrible

Since I’m developing the iPhoneNotes application i worked alot with the iPhone Notes database. This database is the data-source for my app. But it has a terrible layout:
CREATE TABLE Note (creation_date INTEGER, title TEXT, summary TEXT)
CREATE TABLE note_bodies (note_id INTEGER, data, UNIQUE(note_id))

  • column note_id is assigned to the rowid from the Note table (don’t like that but it works)
  • In the Note database is the title of the note stored. And in the summary column is the content of the note store if it isn’t too big (absolutely don’t understand why?!?!)
  • the data column from the note_bodies database contains the content of the note always. But in a really strange pseudo HTML format. Every line is in a div element and sometimes it has a br element at the end of the line. The problem is that these div tags are not every time closed correct. So it is impossible to parse it with an XML parser.(I hate things like that)
  • Because the content of the note is stored twice it has a terrible data redundancy! I don’t understand why that is needed.

So Apple please update the notes application in version 2.0. The actual note’s db is not how things should be done!

V1ru8 on March 21st 2008 in iPhone with tags:, , , ,

4 Responses to “The iPhone Notes DB - Terrible”

  1. Riccardo responded on 22 Jun 2008 at 15:51 #

    Hi,
    does anybody can tell me how to convert the ITEGER type of the field “creation date” to date type or any timestamp field type?

    Many thanks,
    Riccardo

  2. V1ru8 responded on 22 Jun 2008 at 16:04 #

    NSDate *creationDate = [NSDate dateWithTimeIntervalSince1970:valueOfTheCreationDateField];

    Or do you mean directly in the Database? Because I don’t think that SQLite has support for a “Date” format.

  3. Riccardo responded on 22 Jun 2008 at 16:27 #

    No, not directly I need to apply a conversion procedure to the field’s value: once imported in a tex field of a filemaker solution.

    So I think what you suggested is a good solution, but probably i have to start calculating date from 01/01/1970 00:00? Becacause It seems to contain also a hour value.

  4. Riccardo responded on 22 Jun 2008 at 23:05 #

    Good: I found:
    the date in iPhon end iPd Touch is indicated in number of secnds starting on 01/01/2001 at 00:00 (GMT).

Trackback URI | Comments RSS

Leave a Reply