Help get this topic noticed by sharing it on Twitter, Facebook, or email.

No visible @interface for 'UIAlertView' declares the selector 'initWithTitle:message:deluge:cancelButtonTitle:otherButton'

My problem is that I'm only on page 18 and i am supposed to enter the code in and it should work, i don't have the knowledge yet to troubleshoot the error. I have my code below, can anyone point me in the right direction were I might have a mistake?

//
// ViewController.h
// HelloCocoa
//
// Created by me on 1/14/13.
// Copyright (c) 2013 Andrew DiNatale. All rights reserved.
//

#import

@interface ViewController : UIViewController
@property (strong, nonatomic) IBOutlet UIView *helloButton;
- (IBAction)showAlert:(id)sender;
@end

//
// ViewController.m
// HelloCocoa
//
// Created by Andrew DiNatale on 1/14/13.
// Copyright (c) 2013 Andrew DiNatale. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

- (IBAction)showAlert:(id)sender
{
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Hello!"
message:@"Hello, World!"
delegate:nil
cancelButtonTitle:@"Close"
otherButtonTitle:nil];
[alert show];
[_helloButton setTitle:@"I was Clicked!" forState:UIControlStateNormal];
}
@end
1 person has
this question
+1
Reply