How to map UITableView cell to a remote database backend?
===

I'm making a simple To-Do list app for the iPhone with a rails backend.

So far, I can pull all the `tasks` in a To-Do list from the web app, parse the JSON, and insert it into the UITableView.

The json response from rails:

    [
      {"id":1,"name":"Buy bread"},
      {"id":8,"name":"Get gas"},
      {"id":14,"name":"Call John"}
    ]

In the UITableView, a row for each task, the textLabel of the cell is the name of the task:

![enter image description here][1]

 
The problem I'm having now is how to associate the cell with the record id of the task. 

Two tasks can have the same name, so I can't just get the id from the hash based only on the name.

I need the record id, so I can post back to the rails app, after the user edits the UItableView (deletes a task for example).

Is there a property I can set on the cell? I feel like I'm missing something obvious. This is my first iPhone app, so please be gentle, hehe.




 


  [1]: http://i.stack.imgur.com/e0EnI.png