Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: iPhone and iPad App 24-Hour Trainer
This is the forum to discuss the Wrox book iPhone and iPad App 24-Hour Trainer Abhishek Mishra, Gene Backlin; ISBN: 978-1-1181-3081-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: iPhone and iPad App 24-Hour Trainer 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
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 21st, 2012, 08:07 PM
Wrox Author
Points: 362, Level: 6
Points: 362, Level: 6 Points: 362, Level: 6 Points: 362, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2010
Posts: 61
Thanks: 0
Thanked 9 Times in 7 Posts
Default Current Errata additions

Here is a composite of all emails with errata I have received from readers.

page 14
point 3.2…doesn't state new color to be set.
page 14
point 5.4…the image files are NOT on the DVD. They are in the source code download.
pages 58-59 in the Lesson 4 Try It
there is no mention of @synthesize textLabel.
This is a major gaffe for an introduction to outlets and actions.
the statement does show in the video. I hope my students find it.


Here are some issues I came across in Chapter 5.
Some are not errata but are due to Xcode updates.

Page 69: Step 1 incorrectly identifies the project as FruitList. It’s FruitTest.
Page 71: Step 4.2 should be after the line @implementation Lesson5ViewController.
Page 72: Step 5.3 should be select the Objective-C Class (in Xcode 4.5.1).
Page 75: Omission after Step 5, @synthesize all outlet properties in the FruitDetailViewController.m file.
Page 76: Step 12.3, only one segue circle may show up in Xcode . If 4.5.1. The three segue choices appear when mouse is released. Select Modal.
Page 78: Step 13.2, omission...should be “method in” Lesson5ViewController.m.
Page 79: Step 13: the dataObject errors will fix up after Step 15.

Possible Errata after page 79:

At this point, I have gone through Lessons 1-9. The latter chapters are mostly error-free. A recurring issue has been the omission of @synthesize statements. I note these below. The videos are a big plus.

page 90, insert @synthesize reminder between Steps 7.5 and 7.6.
page 90, Step 8.5 has a typo…should be "Add the following lines".
page 100, insert new Step 4.3 informing reader to @synthesize userLabel.
page 108, need @synthesize reminder for largeImage and animatedImage.
page 116, you kindly mention @synthesize in Step 4.2 but didn't include cityAndSubjectPicker.

1. page 121: initWithTimeIntervalSinceReferenceDate creates a date
relative to midnight on January 1, 2001. You were thinking of initWithTimeIntervalSince1970.
2. page 121 minor typo in last line on page…should be textualRepresentation.

I would like to thank all readers who have brought these to my and the publisher's attention.

Take Care,
Gene Backlin

Last edited by gbacklin; October 28th, 2012 at 08:10 PM.
Reply With Quote
  #2 (permalink)  
Old February 24th, 2013, 09:59 PM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Could you explain @Synthesize For Us?

I picked up this book yesterday after struggling along with a couple of other authors. Your writing style and comprehensive definitions of what is where and how things work is a perfect match for my learning style.

As you may have expected, I stumbled once I hit Chapter 4 with the missing @synthesize instructions. I haven't found any reference to @synthesize in the index either, so perhaps coverage of this is completely missing from the book(?)

If this is so, could you be so kind as to post a definition and description of @synthesize in the same style as is used in the book so that I can wrap my mind around the how and why of @synthesize? (VERY OLD Basic developer here...)

If there is a definition already in the book, feel free to tell me what page to find it on.

Much appreciated!
Reply With Quote
  #3 (permalink)  
Old February 24th, 2013, 10:08 PM
Wrox Author
Points: 362, Level: 6
Points: 362, Level: 6 Points: 362, Level: 6 Points: 362, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2010
Posts: 61
Thanks: 0
Thanked 9 Times in 7 Posts
Default

Quote:
Originally Posted by RonMcMahon View Post
I picked up this book yesterday after struggling along with a couple of other authors. Your writing style and comprehensive definitions of what is where and how things work is a perfect match for my learning style.

As you may have expected, I stumbled once I hit Chapter 4 with the missing @synthesize instructions. I haven't found any reference to @synthesize in the index either, so perhaps coverage of this is completely missing from the book(?)

If this is so, could you be so kind as to post a definition and description of @synthesize in the same style as is used in the book so that I can wrap my mind around the how and why of @synthesize? (VERY OLD Basic developer here...)

If there is a definition already in the book, feel free to tell me what page to find it on.

Much appreciated!
Hi Ron,

in the old days (like in the NeXTSTEP days) when you declared a variable in the interface (.h) file, you would manually code your setter and getters.

When this book was written you would type:
@property (strong, nonatomic) NSString *value;

in the interface (.h) file and then in the implementation (.m) file you would type:

@synthesize value;

This would automatically give you setters and getters:

[self setValue@"some string"];

NSString *myValue = [self value];

Thus you would not have to write the setters and getters if you used @property/@synthesize

In the latest Xcode and iOS 6.x you no longer have to include the @synthesize anymore if you use the @property.

Is that as clear as mud ?

Reply With Quote
  #4 (permalink)  
Old February 25th, 2013, 01:46 AM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default A muddy hole...

First let me thank you for your very fast response and fairly good explanation. I'm still wrapping my mind around the set and get structure, adjusting it from my use of it in VB6 (yeah, I'm ancient).

Where you lost me is your assertion that @synthesize is no longer necessary if I use @property, which would mean that the code in the book by 'missing' the @synthesize portion is just fine because it still directs readers to use @property (My assumption.)

If this is true, then there is some setting on my Mac that I'm missing because my copy of xCode is saying that it is Version 4.6 (4H127). The iPhone simulator says that it is the iPhone 6.1 Simulator, yet if I remove the line @synthesize textLabel; command from the .m file I get an error saying "Use of undeclared identifier 'textLabel'; did you mean '_textLabel'?" and the system offers to 'fix' it (but the fix doesn't result in a functioning app.)

The only thing that I can think may have to do with this is that your response quotes:

@property (strong, nonatomic) NSString *value;

But the code in the video and book use a weak not strong storage value...
Reply With Quote
  #5 (permalink)  
Old February 25th, 2013, 04:56 AM
Wrox Author
Points: 362, Level: 6
Points: 362, Level: 6 Points: 362, Level: 6 Points: 362, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2010
Posts: 61
Thanks: 0
Thanked 9 Times in 7 Posts
Default

Quote:
Originally Posted by RonMcMahon View Post
First let me thank you for your very fast response and fairly good explanation. I'm still wrapping my mind around the set and get structure, adjusting it from my use of it in VB6 (yeah, I'm ancient).

Where you lost me is your assertion that @synthesize is no longer necessary if I use @property, which would mean that the code in the book by 'missing' the @synthesize portion is just fine because it still directs readers to use @property (My assumption.)

If this is true, then there is some setting on my Mac that I'm missing because my copy of xCode is saying that it is Version 4.6 (4H127). The iPhone simulator says that it is the iPhone 6.1 Simulator, yet if I remove the line @synthesize textLabel; command from the .m file I get an error saying "Use of undeclared identifier 'textLabel'; did you mean '_textLabel'?" and the system offers to 'fix' it (but the fix doesn't result in a functioning app.)

The only thing that I can think may have to do with this is that your response quotes:

@property (strong, nonatomic) NSString *value;

But the code in the video and book use a weak not strong storage value...
Ok, now I think I see what is going on and is directly related to the newer version of Xcode and iOS 6.

Pre iOS 6 you could say:

textLabel.text = @"some text";

after declaring @property/@synthesize the variable (my use of strong was just an example, and not related to your issue)

But pre iOS 6 saying textLabel.text you were directly accessing that variable, but now with iOS 6 by default the @synthesize is defined as:

@synthesize (textLabel=_textLabel);

So your line textLabel.text = @"some text"; would preferably be

self.textLabel.text = @"some text";

or _textLabel.text = @"some text";

The subject of setters and getters also a long time ago were called modifiers and accessors :)

It was practice for some to directly access a declared instance variable for an object. Some used it and others advised against it, suggesting to use methods instead to either assign or retrieve the values for that variable. This then led to the use of setters and getters.

This also then was suggested to use the self (or this, if you came from a java background) declaration to further refine the use of method access/modify with the variable's value.

Visual Basic programmers I knew at the time just simply directly accessed the declared variables, thus had no need to use any methods to access or modify any declared variables, as developers of regular BASIC back in the A$ days !

So my suggestion if you used @property/@synthesize which establishes the set/get methods for your value interaction, I would also then suggest use:

this to precede the variable to use the set/get structure as I this.textLabel.text = @"some text";

Does that help any ?
Reply With Quote
Reply


Thread Tools
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
XSLT recursive Additions raafishaafi XSLT 2 January 13th, 2009 10:41 AM
No additions using VBA and SQL Bob Pierce Access VBA 1 February 6th, 2007 12:20 PM
Showing 5 latest additions, problem with sorting Konfu XSLT 0 March 11th, 2006 09:21 AM
textboxes and additions toiletgraffiti C# 4 January 23rd, 2006 10:50 AM
Access 2000 "Open ODBC SQL Table for Additions" cjdphlx Access VBA 3 July 18th, 2005 02:05 PM



All times are GMT -4. The time now is 09:00 AM.


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