I am very new to iOS development and I have the following question: In my code, I have a UIViewController with a UIText field that will contain the password when the user enters the view. The password is used for authentication to the server:
UItextField* txtPassword; [myClass loginWithPassword:txtPassword.text];
After use, I want to be sure that there is no password left in the memory, so an attacker will not be able to dump the iPhone and extract the password from it.
In windows, for example, I could use the SeucreZeroMemory function to fill a block of memory with zeros.
What is the best way to do this for iOS? Who is responsible for freeing the UItextField* string, and is that enough?
source share