show a button through alertview button in view controller

Viewed 204

I have a alertview it appears every time when the app is launched. I want to show a button on a viewcontroller when I clicked show button of alertview when I clicked on cancel then button then this button will not show. I am using this code to do this.

- (void )alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 0)
{

    ViewController *controller = [[ViewController alloc]init];
    controller.button.hidden= NO;
}

and in viewcontroller I create the outlet of button. and done the below code in view did load of view controller but I am unable to show the button

- (void)viewDidLoad 
{
[super viewDidLoad];

self.button.hidden = YES;
}
4 Answers
Related