UIDatePicker memory leak IOS 14 (inline, compact)

Hello folks,

i recognized if iam using the UIDatePicker with the inline or compact style, it will hold every time memory even if the ViewController is already released.
To make sure iam not wrong, i created a simple project with two ViewController. At the first one i added a button to open the second ViewController, which holds the UIDatePicker with the inline style. Every time i open the ViewController 2, it will retain memory and it is never releasing it?

Some People have the same issue?
Is there something i have to take care of, using the DatePicker in this style?

Thanks in advance!
Answered by AlexUhl in 652140022
Hello Claude31,

first i realized it in my project that the memory was increasing a lot for one specific ViewController, i was searching for a long time, till i came up to the datePicker with the inline style.
Then i created a new project, what i explained on the top of this thread.
If you run this simple 2 ViewController app with the datePicker on the second viewController and open the second ViewController and closing it 20x or so, the memory will increase the whole time and it will never been released.

Iam using Xcode 12.2 and macOS Catalina (Version 10.15.7).

it will retain memory and it is never releasing it

How did you check it retains memory ?
So I understand it does not occur if not inline nor compact ?
Accepted Answer
Hello Claude31,

first i realized it in my project that the memory was increasing a lot for one specific ViewController, i was searching for a long time, till i came up to the datePicker with the inline style.
Then i created a new project, what i explained on the top of this thread.
If you run this simple 2 ViewController app with the datePicker on the second viewController and open the second ViewController and closing it 20x or so, the memory will increase the whole time and it will never been released.

Iam using Xcode 12.2 and macOS Catalina (Version 10.15.7).
Thanks for feedback.

You closed the thread, so I understand you got the answer you expected.

Otherwise, may have a look here to further investigate:
https://stackoverflow.com/questions/9028209/uidatepicker-memory-leak-with-arc
No sorry I accidentally clicked on the chechmark, while answering to you question 😅
This is the first time Iam using the developer forum from apple.
The problem is still not solved...

I met the same problem with inline UIDatePicker. I'm using Xcode 12.4.

Have you guys found a solution?

UIDatePicker memory leak IOS 14 (inline, compact)
 
 
Q