 |
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
|
|
|

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

July 22nd, 2010, 08:01 AM
|
Registered User
|
|
Join Date: Jul 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

July 22nd, 2010, 11:58 AM
|
Registered User
|
|
Join Date: Jul 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I did. is there a reason so much stuff is showing up in red?
|

July 27th, 2010, 12:18 AM
|
Registered User
|
|
Join Date: Jul 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|

July 27th, 2010, 01:20 AM
|
Registered User
|
|
Join Date: Jul 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

July 27th, 2010, 01:45 AM
|
Registered User
|
|
Join Date: Jul 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

August 23rd, 2010, 11:53 AM
|
Registered User
|
|
Join Date: Aug 2010
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
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
|

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

August 23rd, 2010, 12:43 PM
|
Registered User
|
|
Join Date: Aug 2010
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
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.
|

August 24th, 2010, 11:47 AM
|
Friend of Wrox
|
|
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
|
|
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.
|
|
 |
|