presentModalViewController:Animated is deprecated in ios6

前端 未结 5 1301
醉梦人生
醉梦人生 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 14:56

    [[Picker presentingViewController] dismissViewControllerAnimated:YES completion:nil];
    

    Instead of

     [[Picker parentViewControl] dismissModalViewControllerAnimated:YES];
    

    and

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

    Instead of

    [self presentModalViewController:picker animated:YES];
    

提交回复
热议问题