Wrox Programmer Forums
|
BOOK: Beginning iPad Application Development
This is the forum to discuss the Wrox book Beginning iPad Application Development by Wei-Meng Lee; ISBN: 9780470641651
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning iPad Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 7th, 2010, 08:30 AM
Registered User
 
Join Date: Dec 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hello World

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
 
Old December 7th, 2010, 09:34 AM
Registered User
 
Join Date: Dec 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

nevermind... I forgot a bracket..





Similar Threads
Thread Thread Starter Forum Replies Last Post
hello world! help :( archer11 BOOK: Beginning iPad Application Development 11 August 24th, 2010 01:27 PM
Hello World Example Chapter 1 goboomer BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 12 January 14th, 2009 10:07 PM
ASP "Hello World" Bill_Thompson ASP.NET 2.0 Basics 3 December 14th, 2007 09:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.