View Single Post
  #1 (permalink)  
Old March 1st, 2009, 09:44 PM
abowman abowman is offline
Registered User
Join Date: Mar 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 6 Todo List removeItem

To get removeItem to work correctly in chapter 6, add the id field to the ToDoItem class (create a getID function and also update the constructor to accept the id). When the items are created in updateArray, get the id and pass it to the new ToDoItem as you do for the task and date. Now, when you want to remove an item, you can get the id of the item and pass it to the removeItem function (delete the code that inverses the index).
Reply With Quote