Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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)
  #2 (permalink)  
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.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:21 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.