Wrox Programmer Forums
BOOK: Beginning iPhone SDK Programming with Objective-C
This is the forum to discuss the Wrox book Beginning iPhone SDK Programming with Objective-C by Wei-Meng Lee; ISBN: 978-0-470-50097-2
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning iPhone SDK Programming with Objective-C section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 21st, 2010, 07:38 PM
Registered User
Join Date: Feb 2010
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default Chapter 2: Hello World

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:

Method 1:
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).

Method 2:
If you still want to create outlets and actions in Interface Builder, you now have to go to the Library window (ToolsLibrary). 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...

Last edited by londo-cat; February 21st, 2010 at 07:40 PM.. Reason: corrected spelling...
The Following User Says Thank You to londo-cat For This Useful Post:
Ricacomp (July 12th, 2010)
Old July 12th, 2010, 07:09 PM
Registered User
Join Date: Jul 2010
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default Thanks again

Thanks man, I was about to lose it looking for that. I appreciate it.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hello World Example Chapter 1 goboomer BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 12 January 14th, 2009 10:07 PM
ASP "Hello World" Bill_Thompson ASP.NET 2.0 Basics 3 December 14th, 2007 09:38 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.