Hi I've started with this book. And I'm just at Hello World and the program is already giving me errors..
I've tried the code that came with the book... which is:
Code:
#import "HelloWorldViewController.h"
@implementation HelloWorldViewController
-(IBAction) btnClicked: (id) sender{
//---display an alert view---
UIAlertView *alert = [UIAlertView alloc]
initWithTitle:@"Hello World!"
message:@"iPad, here I come!"
delegate:self cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
}
when I use this code the debugger gives me an error that I need to put an ; after each line.
So I put one after each line and my code then looks like this:
Code:
#import "HelloWorldViewController.h"
@implementation HelloWorldViewController
-(IBAction) btnClicked: (id) sender{
//---display an alert view---
UIAlertView *alert = [UIAlertView alloc];
initWithTitle:@"Hello World!"; message:@"iPad, here I come!";
delegate:self; cancelButtonTitle:@"OK";
otherButtonTitles:nil];
[alert show];
[alert release];
}
and then the debugger gives me an error on "otherButtonTitles:nil];"
expected ";" before "]" token.
but I don't know what to do then... everything I try ends up with an other error.
Does anyone know what the source of these very strange errors is?
I'm new at iPad programming/Objective C so please be gentle. :)
I'v looked it up on the internet and that gives me the same code as the original book code. So I don't know why the original code doesn't work...
Best Regards
Bennie98