UIAlertView first deprecated IOS 9

后端 未结 10 1288
南笙
南笙 2020-11-28 02:29

I have tried several ways to use UIAlertController,instead of UIAlertView. I tried several ways but I cannot make the alert action work. Here is my code that works fine in I

10条回答
  •  执笔经年
    2020-11-28 02:46

    Check this:

    UIAlertController *alertctrl =[UIAlertController alertControllerWithTitle:@"choose Image" message:nil preferredStyle:UIAlertControllerStyleActionSheet];
        UIAlertAction *camera =[UIAlertAction actionWithTitle:@"camera" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
            [self Action];  //call Action need to perform 
        }];
    
    [alertctrl addAction:camera];
    -(void)Action 
    
    {
    
    }
    

提交回复
热议问题