Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 9, 2009, 08:58 PM   #1
John Baughman
macrumors member
 
Join Date: Oct 2003
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.

John
John Baughman is offline   0 Reply With Quote
Old Jul 9, 2009, 09:33 PM   #2
mdeh
macrumors 6502
 
Join Date: Jan 2009
Quote:
Originally Posted by John Baughman View Post
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
So, for whatever reason you are sending a message to an object that is unable to respond to it.

Quote:
In IB I replaced the ArrayController with a custom object.
I did this sans custom object. Just use the delegate methods and datasource as Hillegass did in the earlier chapters. If you really get stuck, contact me privately and I will zip you my attempt.

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.
mdeh is offline   0 Reply With Quote
Old Jul 10, 2009, 08:39 AM   #3
petron
macrumors member
 
Join Date: May 2009
Location: Malmo, Sweden
Send a message via ICQ to petron
Hi, John.

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

Good Luck

/petron
petron is offline   0 Reply With Quote
Old Jul 10, 2009, 02:55 PM   #4
John Baughman
Thread Starter
macrumors member
 
Join Date: Oct 2003
Quote:
Originally Posted by petron View Post
Hi, John.

: forgot some retain, or have too many releases and released object that you want to use

Good Luck

/petron
Petron, I think that your observation is probably the culprit here. I really do not have a handle on garbage collection yet.

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.

Thanks,

John
John Baughman is offline   0 Reply With Quote
Old Dec 13, 2009, 04:30 AM   #5
zbhagg
macrumors newbie
 
Join Date: Dec 2009
Aaron Hillegass, Chapter 8, Challenge 2

I ffigured it out!. Should have been more attentive when copying code from
Hillegass book.

Last edited by zbhagg; Dec 13, 2009 at 01:18 PM. Reason: I found a solution!
zbhagg is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
"Unrecognized selector" error when attempting to remove an object while in a for loop moonman239 iPhone/iPad Programming 18 Feb 26, 2014 08:29 AM
Resolved: [_NSCFNumber setTableViewStyle:] unrecognized selector set to instance moonman239 iPhone/iPad Programming 2 Nov 18, 2013 07:14 PM
Resolved: Unrecognized selector sent to instance Blakeasd iPhone/iPad Programming 2 Jul 2, 2013 09:01 PM
unrecognized selector sent to instance with Coredata and Category of NSMangedObject roeik iPhone/iPad Programming 5 Sep 5, 2012 06:40 AM
unrecognized selector larswik iPhone/iPad Programming 6 Jun 20, 2012 11:46 PM

Forum Jump

All times are GMT -5. The time now is 08:09 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC