Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Objective-C code problem?

Hi guys, im brand new to the Objective-C code and thats why I bought a book, "head first iPhone Development", and I have Xcode3.


problem-

I'v run into a few problems with the code from the book on my compiler. i just started out on my book and have already got a problem 😟


iDecideViewController.h

#import <UIKit/UIKit.h>


@interface iDecideViewController : UIViewController {


IBOutlet UILable *decisionText;

}

@property (retain, nonatomic) UILable *decisonText;


-(IBAction)buttonPressed:(id)sender;

@end


expected specifier-qualifier-list before 'UILable'


im getting this error on line 5

IBOutlet UILable *decisionText;

and on line 7

@property (retain, nonatomic) UILable *decisonText;


and another problem on this file & code


iDecideViewController.m

#import "iDecideViewController.h"


@implementation iDecideViewController

@synthesize decisionText;


-(IBAction)buttonPressed: (id)sender

{


decisionText.text = @"Go for it!";

}


no declaration of property 'decisionText' found in the interface

this error on line 4

@synthesize decisionText;


'decisionText' undeclared (first use in this function)

this code on line 8

decisionText.text = @"Go for it!";

- (void)dealloc {

[decisionTextrelease];

[super dealloc];

}


'decisionText' undeclared (first use in this function)

this error on line 3

[decisionTextrelease];

========================================


So after all that my question is, is my code wrong/outdated or what? im typing right from the book.

and could anyone redirect me to a Objective-C book or what-have-you?





Mac OS X (10.6.8)

Posted on Feb 18, 2012 7:37 PM

Reply
Question marked as Best reply

Posted on Feb 18, 2012 7:57 PM

That should be spelled "UILabel"


Maybe checkout this new site Apple just posted:

https://developer.apple.com/library/ios/#referencelibrary/GettingStarted/RoadMap iOS/Introduction/Introduction.html

2 replies

Objective-C code problem?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.