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 July 21st, 2010, 03:17 PM
Registered User
 
Join Date: Jul 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default hello world! help :(

I'm brand new to this and do not know Objective -C or any programing language for that matter. I don't know what I'm doing wrong I do everything it says on page 38 but I cannot get the pop up to show itself when the simulator is ran. Here is what I have entered:


#import "HelloWorld2ViewController.h"

@implementation HelloWorld2ViewController

-(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];
}


Thanks for your help!!!
 
Old July 22nd, 2010, 08:01 AM
Registered User
 
Join Date: Jul 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did you link the button on the View to the btnClicked action in your code as described at the top of page 38?
Control click the button (from Interface Builder) and drag to the File Owner. Choose btnClicked in the window that pops up.
 
Old July 22nd, 2010, 11:58 AM
Registered User
 
Join Date: Jul 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I did. is there a reason so much stuff is showing up in red?
 
Old July 27th, 2010, 12:18 AM
Registered User
 
Join Date: Jul 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I believe you are referring to the red characters in your source code. The default for syntax highlighting is to put strings in red. You can customize this from the fonts & colors section in preferences.

Were you able to get your code working?
 
Old July 27th, 2010, 01:20 AM
Registered User
 
Join Date: Jul 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No, I haven't honestly I've been hoping for a little more help on here. Thanks for the info though! I thought maybe red meant there was an error.
 
Old July 27th, 2010, 01:45 AM
Registered User
 
Join Date: Jul 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How are you launching the simulator for testing?

If you launch it from Interface Builder then your code will not be executed, which means the alert will not pop when you touch the button.

You need to launch it from Xcode to get your code to run in the simulator.
 
Old August 23rd, 2010, 11:53 AM
Registered User
 
Join Date: Aug 2010
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi,
I am also new to this coming from PC World.
When I do Control-click the round Rect Button and drag it to the File's Owner item,
there is only a windows with Outlet and Delegate coming up and no btnClicked action.
What did I do wrong?
Appreciate your help. Thanks!

Rick
 
Old August 23rd, 2010, 12:00 PM
Registered User
 
Join Date: Aug 2010
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

OK now. found my problem. typo in the line. Thanks anyway.
 
Old August 23rd, 2010, 12:43 PM
Registered User
 
Join Date: Aug 2010
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Not getting very far for this, I also cannot get the pop up when I click on the simulator.
Look at the .m file, I got the following warning:

warning: no '-initWithTitle:message:deletegate:cancelButtonTitle :otherButtonTitles:' method found

Help please. Thx.
 
Old August 24th, 2010, 11:47 AM
Friend of Wrox
 
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
Default

Is the warning that you posted exactly what appears?
If so, two things are apparent. First, delegate is spelled incorrectly, and 2nd the "destructiveButtonTitle:" argument is missing. This will generate the warning since it is not a legitimate method.
As often as possible use the autocomplete feature in Xcode, since this will eliminate typing errors and will only provide completions for valid methods.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How many VS developers are there all over the world? Trinominal Visual Studio 2008 3 April 23rd, 2009 01:02 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.