Hello,
Has anyone used the new edition of Cocoa Programming for OS X? I'm a newbie to Objective-C and Mac programming, but I've been doing OOP programming in PHP for 3 years. I've been dabbling with C for a couple of months, so I feel comfortable enough reading and understanding Aaron Hillegass's book.
Anyway, in Chapter 6, after the discussion on dataSource, there is a challenge to make a Todo List application with a text field, a table view, and a button that adds the text from the text field to the table view.
I did this successfully, and was then ready to move on to the extra credit assignment: make the table view editable. The author even gives a hint: NSMutableArray has a method -replaceObjectAtIndex:withObject:.
Now I'm stuck. I'm thinking that I should use a delegate method for the table view and use the above method to replace the entry in the array. There are two specific problems I'm facing. The first is that I can't find the appropriate delegate method to use that will allow me to edit the row. The second is that even if I did know that delegate, I wouldn't know what to call the object that represents the row that I'm editing.
Any thoughts? suggestions?
Has anyone used the new edition of Cocoa Programming for OS X? I'm a newbie to Objective-C and Mac programming, but I've been doing OOP programming in PHP for 3 years. I've been dabbling with C for a couple of months, so I feel comfortable enough reading and understanding Aaron Hillegass's book.
Anyway, in Chapter 6, after the discussion on dataSource, there is a challenge to make a Todo List application with a text field, a table view, and a button that adds the text from the text field to the table view.
I did this successfully, and was then ready to move on to the extra credit assignment: make the table view editable. The author even gives a hint: NSMutableArray has a method -replaceObjectAtIndex:withObject:.
Now I'm stuck. I'm thinking that I should use a delegate method for the table view and use the above method to replace the entry in the array. There are two specific problems I'm facing. The first is that I can't find the appropriate delegate method to use that will allow me to edit the row. The second is that even if I did know that delegate, I wouldn't know what to call the object that represents the row that I'm editing.
Any thoughts? suggestions?