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](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIAlertController_class/) has a different interface than UIAlertView. You must use a different constructor that takes in just the title, message, and preferred style.

Then you can add actions to the UIAlertController once defined. Click on the hyper link which will take you to Apple's documentation where they also provide an example of how to use a UIAlertController.
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];

```