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 March 7th, 2013, 04:25 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, 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 Newbie coding problem

Hi, I have just finished CH 6 of iPhone/Ipad App book and am enjoying not only the book but the excellent videos.
I am having a re-occurring problem in the implementation files (.m file) when I go to RUN after finishing I am finding the syntax checker wants me to rename fields from (for example); usernameField to _usernameField.
Due to this, the compiler does not complete and shows an error status.

I notice in the TRY completed solutions (which work fine) that the syntax checker wants the same fields renamed.

I am running OSX 10.8.2, and Xcode 4.6

any ideas please?
Cheers

JIm
Reply With Quote
  #2 (permalink)  
Old March 16th, 2013, 12:16 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 jimpilot View Post
Hi, I have just finished CH 6 of iPhone/Ipad App book and am enjoying not only the book but the excellent videos.
I am having a re-occurring problem in the implementation files (.m file) when I go to RUN after finishing I am finding the syntax checker wants me to rename fields from (for example); usernameField to _usernameField.
Due to this, the compiler does not complete and shows an error status.

I notice in the TRY completed solutions (which work fine) that the syntax checker wants the same fields renamed.

I am running OSX 10.8.2, and Xcode 4.6

any ideas please?
Cheers

JIm
Hi Jim, and thank you for the nice comments about the book and videos.

What you are experiencing is the change from Xcode/iOS 5.1 to 6.x. in 5.x you could say:

In the *.h (interface) file:

@property (strong, nonatomic) NSString *name;

and in the *.m (implementation) file:

@synthesize name;

Then in you methods say.

name = @"Joe";

Now with 6.x you no longer need to @synthesize name; in the *.m file, however what is going on in the background is this:

@synthesize name=_name;

So the reason that Xcode is asking for you to make it _name instead of name:

_name = @"Joe";

Is because of the default action that you are getting this error.

What I would suggest is to do it the way we did back in the NeXTSTEP days

[self setName:@"Joe"];

or if you use dot notation instead of brackets:

self.name = @"Joe";

One thing to note is that when the book was originally started, iOS 5.0 was in beta so the text was written against that standard when the book would be released. The videos were created after the text was written, edited, approved and sent off to print. When the videos were being created, Apple was then beta testing iOS 5.1. Xcode once again changed a number of things. So some things will not exactly line up with the text.

When in doubt, please go to the video as the TryIt's step by step with 5.1 will still work with today's 6.1, while the text because of being based on 5.0, may differ with 6.1.

Thank you again for your feedback, I would have responded sooner, but I did not get a notification via email that this new post was created.

If you have any more questions, please append this thread, so I will get a notification and can respond promptly.

Take Care,
Gene Backlin
Reply With Quote
  #3 (permalink)  
Old March 16th, 2013, 06:57 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Many thanks Gene for a very clear explanation.

Your advice has been noted,

Best wishes

Jim
Reply With Quote
  #4 (permalink)  
Old March 16th, 2013, 07:01 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 jimpilot View Post
Many thanks Gene for a very clear explanation.

Your advice has been noted,

Best wishes

Jim
Anytime Jim, and once again thank you for your support. It is greatly appreciated.

Take Care,
Gene Backlin
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
Convert DAO Coding to ADO Coding udaybg1 VB How-To 0 August 9th, 2011 08:50 AM
i need help for my coding problem... danielnixon C# 2 May 19th, 2008 03:51 PM
javascript coding problem hosefo81 Javascript How-To 3 December 4th, 2003 03:56 AM



All times are GMT -4. The time now is 02:08 PM.


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