presentModalViewController:Animated is deprecated in ios6

前端 未结 5 1275
醉梦人生
醉梦人生 2020-12-07 14:19

I am using the following code for an image picker. But when I run it in the simulator, I have a memory leak and I get a warning about presentModalViewcontroller:animat

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 15:15

    Use:

    [self presentViewController:imagePicker animated:YES completion:nil];
    

    And then for your dismissal modal use:

    [self dismissViewControllerAnimated:controller completion:nil];
    

    or

    [self dismissViewControllerAnimated:YES completion:nil];
    

提交回复
热议问题