In version 3.0 of the iPhone SDK, Interface Builder allows you to create outlets and actions in the Identity Inspector window, as shown in the various figures in the book. An example is the Figure 2-21, shown on Page 36.
However, in the latest version of the iPhone SDK (3.1.2), Interface Builder (3.2.1) removed the Class Actions and Class Outlets sections in the Identity Inspector window.
Wei-Meng Lee updated the book with a PDF update regarding this and posed two possible workarounds for this issue:
Wei-Meng wrote that there were two easy ways to solve the problem, and he details them below:
Instead of creating outlets and actions in the Identity Inspector window, simply declare them in the header (.h) file. Once you have declared the outlets and actions in the .h file, you can go back to Interface Builder and perform the connections. In my book, I often show creating the outlets and actions in Interface Builder first, and then declare them in the .h file. So, with the latest version of Interface Builder, you just need to skip the first step and jump directly to the second step (declare them in the .h file).
If you still want to create outlets and actions in Interface Builder, you now have to go to the Library window (ToolsLibrary). Click on the Classes tab (see figure below), select the view controller (e.g. HelloWorldViewController) and then create the outlets or actions.
While this allows you to create the outlets or actions in your code and associate it with the button, it took me about 4-5 times to get the code to work properly!
At first, all I got was that the definitions were not properly declared error on compile, but after going over the notes and doing it again - then trying to 'CLOSE OUT' interface builder, which prompted me to save my changes I had made - it THEN saved it's changes to the XIB file.
This allowed me to 'build and run' as previously done, and the simulator then worked as it should.
One would think that the klunky xcode interface would *unilaterally* SAVE any changes you make when you click on 'SAVE'.
Anyway, the code works - and if you need the updated PDF go to: http://www.wrox.com/WileyCDA/WroxTit...-DOWNLOAD.html
This has the updated PDF with corrections and the CODE for the book, but I would like to POINT OUT that the ZIP file for the code contains a blank project for the hello world program.
You STILL have to add in the code and the buttons! WROX (or Wei-Meng Lee) should have updated that...