Having downloaded the project, the author's code presents the label and button, and brings up the alertView as intended, with a gray background. (The layout is not great, the commented out frame (frame = CGRectMake(10, 70, 300, 50);) is a better location for the UIButton than the one actually used.)
One thing that should be done differently, even though they are essentially the same thing, the method
Code:
-(IBAction) buttonClicked: (id) sender{
UIAlertView *alert =
[[UIAlertView alloc] initWithTitle:@"Action invoked!"
message:@"Button clicked!"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
}
should be
Code:
-(void) buttonClicked: (id) sender{
UIAlertView *alert =
[[UIAlertView alloc] initWithTitle:@"Action invoked!"
message:@"Button clicked!"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
}
Even though -IBAction evaluates to -void, its purpose to to indicate that an action method is set in the .xib file, not programatically.
This may be a dumb question, but you did build and run the author's project from Xcode? You aren't running the program directly in the simulator and possibly rerunning your program? (Your and the author's program do have identical names?) Try deleting the program from the simulator and reinstalling it. (Running a different version of a program with the same name does overwrite the previously installed version in the simulator, so this should happen automatically. But I am just speculating about the scenario you are getting)
If you can't resolve your issue send the project to
ipadhelper@me.com
and I will check it out.
Bob