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: Beginning iOS Programming: Building and Deploying iOS Applications
This is the forum to discuss the Wrox book Beginning iOS Programming: Building and Deploying iOS Applications by Nick Harris; ISBN: 978-1-118-84147-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning iOS Programming: Building and Deploying iOS Applications 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 February 27th, 2015, 04:35 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 4

I am really new to this but i have been searching for a day and can't figure out what i am doing wrong. I am using Xcode version 6.1. In chapter 4 when we put in the text field and add the code in the view controller.m file, when i add self.bandobject = [[BandObject alloc] init]; it give me and error. Use of undeclared identifier and asks me if i want to try to change the name to_bandObject. Can someone tell me what i need to fix and the reason this is happening so i know how to avoid it in the future. Thanks in advance.
Here is my code

// ViewController.m
// Bands
//
//
// Copyright (c) 2015 Idea Monkey Studios. All rights reserved.
//

#import "ViewController.h"





@implementation ViewController




- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.

NSLog(@"titleLabel.text = %@", self.titleLabel.text);

self.bandObject = [[BandObject alloc] init];
}

- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
return YES;
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
self.bandObject.name = self.nameTextField.text;
[self.nameTextField resignFirstResponder];
return YES;
}

-(BOOL)textFieldShouldEndEditing:(UITextField *)textField
{
self.bandObject.name =self.nameTextField.text;
[self saveBandObject];
[self.nameTextField resignFirstResponder];
return YES;
}



@end


//
// ViewController.h
// Bands
//
//
// Copyright (c) 2015 Idea Monkey Studios. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "WBABand.h"


@interface ViewController : UIViewController <UITextFieldDelegate>

@property (nonatomic, strong) WBABand *bandObject;
@property (nonatomic, weak) IBOutlet UILabel *titleLabel;
@property (nonatomic, weak) IBOutlet UITextField *nameTextField;

@end
Reply With Quote
  #2 (permalink)  
Old March 31st, 2015, 11:02 PM
Authorized User
Points: 96, Level: 1
Points: 96, Level: 1 Points: 96, Level: 1 Points: 96, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Chapter 4 P82-3

Hi
Just go to Errata and have a look at the changes for Chapter 4.
BandObject should be WBABand //p82
and remove
[self.saveBandObject]; //p83
Cheers
Wendel
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
Chapter 6 - Code Download Missing for this Chapter dbaechtel BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 0 August 11th, 2009 12:02 PM
Chapter 2 - End of chapter exercises whizzkid1892 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 July 30th, 2008 01:02 PM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 10:40 PM



All times are GMT -4. The time now is 12:23 AM.


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