Question: I'm trying to make my first iOS app, and the tutorial asked me to use UIAlertView. XCode informed me that this was deprecated and that I should use UIAlertController. I replaced the instances of UIAlertView with UIAlertController and am still running into problems: it says, "No visible @interface for 'UIAlertController' declares the selector 'initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:'
I would appreciate any help with this. My code is below:

```
//
//  ViewController.m
//  cv
//
//  Created by Frank Michael Tocci on 6/17/16.
//  Copyright © 2016 Frank Tocci. 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.
    UIAlertController * alert = [[UIAlertController alloc] initWithTitle:@"Hello!" message:@"Welcome to OpenCV" delegate:self cancelButtonTitle:@"Continue" otherButtonTitles:nil];
    [alert show];
}

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

@end

```

Answer: 
UIAlertController is not UIAlertView

The way you initialize it and display it is different. Here's how:

```
// Init the alert
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"My Alert"
                                              message:@"This is an alert."
                                              preferredStyle:UIAlertControllerStyleAlert];

// Setup the action for the alert
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" 
                                              style:UIAlertActionStyleDefault
                                              handler:^(UIAlertAction * action) {}];

// Add the defaultAction to the alert (this will add an action button with title "OK" to the alert)
[alert addAction:defaultAction];

// Display it
[self presentViewController:alert animated:YES completion:nil];

```
If you are deploying your application for iOS 8 then just change the deployment target to iOS 8 after this you will not find any depreciation for using `AlertView`.
`AlertView` is depreciated in iOS 9 and above but below iOS 9 it still works fine.