Quote:
Originally Posted by youngcoder
i am doing this:
Code:
- (IBAction)showCheat
{
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Warning!"
message: @"Are You Sure you Want to See the Answer? Beware it Takes 3 Points Away From your Grade"
delegate: self
cancelButtonTitle: @"Cancel"
otherButtonTitles: @"OK"];
[alert show];
[alert release];
}
- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
// the user clicked one of the OK/Cancel buttons
.........
}
but get the following errors on the red line:
Wrong type argument to unary minus
expected ';' before ':' token
thanks for any suggestions
|
As far as the above code is concerned, the method
- (void)alertView
UIAlertView *)actionSheet clickedButtonAtIndex
NSInteger)buttonIndex { is declared inside another method
(IBAction) showCheat.
You should add a curly bracket
} before the definition of the method
-(void)alertView .....
Hope this helps.