|Jul 9, 2009, 08:58 PM||#1|
unrecognized selector (Hillegass chapter 8 challenge 2)
Can't get challenge 2 to work. I get the following in the console and the application hangs without opening the window...
2009-07-09 13:48:24.596 RainManManual[29907:813] *** -[_NSControllerObjectProxy copyWithZone:]:
unrecognized selector sent to instance 0x16c1f0
Is there more code I need to add to what is listed on pages 136-137? If not I suspect I am not setting things up in IB correctly. This exception hits right after the numberOfRowsInTableView method is called. Which I think is the first time the tableView accesses the method.
I made a copy of my working RaiseMan and continued with the original
I did not change anything in person.h
I added the code found on pages 136-137
In IB I replaced the ArrayController with a custom object.
Set the custom object's class to MyDocument
Set the custom object's outlet to the tableView (drag from controller to the tableView
Set the data source and delegate of the tableView to the controller (drag from the tableView to the Controler)
Set the employee and raise column's identifier to personName and expectedRaise in the inspector
Set the sent actions for the Add Employee and Delete buttons to createEmployee and removeEmployee (drag from buttons to Controller)
What am I missing or doing wrong?
Thanks for any help.
|Jul 9, 2009, 09:33 PM||#2|
ps...John, if you have copied pages 136 and 137, you are **really** close to getting it to work. First, delete that custom object, then make the appropriate connections in IB. Remember, File's owner is myDocument. Page 136 essentially implements the manipulation of your datasource, and page 137 implements the delegate methods needed so that the TableView can interact with it's dataSource.
Last edited by mdeh; Jul 9, 2009 at 09:39 PM.
|Jul 10, 2009, 08:39 AM||#3|
I agree with MDEH that you are sending a message to an object that is anable to respond to it.
I did the challenge, but do not remember the details now. I will look at it when back at home.
It seems that you either
: forgot some retain, or have too many releases and released object that you want to use
: wrong or lack of some bindings
: wrong keypaths
|Jul 10, 2009, 02:55 PM||#4|
For MDEH: Thanks I am going to try it without the custom object. I see on the book's forum that others have done it successfuly with a custom object so I think it can be done. I may revisit it and see if I can tinker with the retains and releases a bit and get it to work with the control object.
|Dec 13, 2009, 04:30 AM||#5|
Aaron Hillegass, Chapter 8, Challenge 2
I ffigured it out!. Should have been more attentive when copying code from
Last edited by zbhagg; Dec 13, 2009 at 01:18 PM. Reason: I found a solution!
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Resolved: Chapter 8 TableView unrecognized selector||Parradoxx||iPhone/iPad Programming||6||Apr 19, 2011 10:37 PM|
|A. Hillegass Chapter 6, Challenge 2||MorphingDragon||Mac Programming||6||May 7, 2010 07:11 PM|
|Making NSTableView cells editable (Hillegass chapter 6 challenge)||elorc||Mac Programming||14||Jan 15, 2010 02:39 AM|
|Can't get icon to work (Hillegass chapter 10 pg 164-165)||John Baughman||Mac Programming||6||Jul 17, 2009 04:02 AM|
|unrecognized selector sent to instance||scriptnoob||Mac Programming||2||Jul 26, 2008 10:37 AM|
All times are GMT -5. The time now is 07:19 PM.