---
title: "Problem with method presentModalViewController:Animated in iOS"  
description: "Problem with method presentModalViewController:Animated in iOS"  
author: "Ailsa Singh"  
published: 2015-12-15  
updated: 2015-12-15  
canonical: https://www.mindstick.com/forum/33735/problem-with-method-presentmodalviewcontroller-animated-in-ios  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# Problem with method presentModalViewController:Animated in iOS

I am creating an app, in which I need to move another [view](https://yourviews.mindstick.com/view/84701/layoffs-in-google-india-2023-view) using [method](https://www.mindstick.com/forum/166/webservice-method)presentModalViewController**:**Animated.\
But I have a [memory leak](https://www.mindstick.com/forum/159533/when-a-memory-leak-might-occur-in-c-plus-plus-and-how-can-avoid-it) and a [warning](https://answers.mindstick.com/blog/77/psychological-risks-of-ai-chatbots-what-experts-are-warning-about) about the **presentModalViewController:Animated** being **[deprecated](https://www.mindstick.com/forum/972/deprecated-as-a-property-in-sencha-touch)** in **[iOS](https://www.mindstick.com/articles/12222/core-data-and-how-to-use-it-in-ios-objective-c) 6**.\
and I also get **dismissModalViewController:Animated** deprecated.

Can [anyone tell me](https://www.mindstick.com/interview/23033/can-anyone-tell-me-about-hadoop-toolbox) the method which is useable in the [replacement](https://www.mindstick.com/blog/11708/google-pixel-and-its-quick-screen-replacement) of that method.

## Replies

### Reply by Tarun Kumar

Yes, the above method you specify is deprecated in iOS6. Here are related methods that are deprecated:

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

now above method is used Instead of:

```
[[Picker parentViewControl] dismissModalViewControllerAnimated:YES];
```

and

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

now above method is used Instead of:

```
[self presentModalViewController:picker animated:YES];
```


---

Original Source: https://www.mindstick.com/forum/33735/problem-with-method-presentmodalviewcontroller-animated-in-ios

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
