small medium large xlarge

Generic-user-small
11 Mar 2010, 19:07
Jon Peters (7 posts)

Tim, Just after completing hooking up all the outlets and pushbuttons and running the LookItUp app; I get the console error message: “Could not connect the action: storeValueIntoDictionary: to target of class: MyDocument”.
I get a second message of the same error type for the retrieve pushbutton “..retrieveValueFromDictionary..”

Entering a Key and a Value in the top half of the window to simulating storing a key and a value, pressing the “Store” pushbutton does not clear the fileds as stated in the book: “clicking the Store button will clear the two text fields, and we’ll just have to assume that the information is actually being stored in the dictionary.” Please advise.

Generic-user-small
11 Mar 2010, 19:50
Tim Isted (105 posts)

Hi Jon, There are various reasons why this may occur; please may I ask you to zip up your project files (i.e. the entire directory with Xcode project and class files etc inside) and email it to me. My email address is described at: http://www.timisted.net/blog/contact-details/

That way I can find out what’s causing the problem and post the solution here.

Thanks, Tim

Generic-user-small
12 Mar 2010, 22:31
Jon Peters (7 posts)

Tim, As it turns out, I was able to reconnect one of the pushbuttons and found upon rebuilding that one error msg went away. I tried to re-hook up the other PB but kept getting the same error message. I gave up (before I read your request) and started over with a “clean slate”. The “teaching moment” here (for me) is my confusion as to the logic that “hooking-Up” PBs are “control-dragged” to the File’s Owner in opposite direction to text fields. Can you give me a “crutch” to remember how to “hook-Up” PBs and text fileds in IB? Thanks.

Generic-user-small
13 Mar 2010, 09:55
Tim Isted (105 posts)

Hi Jon, Under previous versions of Interface Builder, you used to have to control-drag in only one direction for any particular type of connection, and there was no popup HUD window with a list of connections. Since Xcode 3, however, it’s possible to connect in either direction. I tend to make use of the popup HUD window for every connection I make (just Ctrl-click on anything in IB to display the HUD with a list of outlets and received actions for any object).

If you don’t like having to drag from the Selector on the push button, it’s also fine to drag from the Received Actions list of File’s Owner over to the push button, so that all connections (both outlets and received actions) are made from the one HUD for File’s Owner.

Does that help? Tim

Generic-user-small
13 Mar 2010, 16:18
Jon Peters (7 posts)

Tim, Well, your explanation of the changes in Xcode 3 was an “Ah-Ha!” moment. I have been struggling with learning Objective-C on and off for a year. During my learning, the early books taught when hooking up fields and PBs, there is a difference in which way to ctl-drag; now that you told me Xcode 3 is “bi-directional” for hook-ups, what I am seeing in the HUDs all becomes clear now. Thanks for your book’s Fig 11.4 of how a successful HUD hook-up is supposed to look like.

Generic-user-small
20 Jan 2011, 14:15
Ric Levy (21 posts)

I had this exact problem, so I’ll post what worked for me in case it’s useful for anyone else…

I had simply mistyped the method name in the implementation. So the buttons were linked to a method called “storeValueInDictionary” in the header, but in the implementation it was called “storeValueinDictionary” (small “i” on “in”). So Interface Builder was linking to a method that was never implemented, hence the errors.

You must be logged in to comment