Posts

Post not yet marked as solved
5 Replies
Thank you eskimo for the reply.When i searched for the address of the string (found in heap memory) in Memory graph, it looked like NSMutableRequest was holding the data even though it is out of scope.NSMutableURLRequest -> NSURLRequestInternal -> CFHTTPMessage -> NSMutableArray -> NSMutableDictionary(Storage) -> NSConcreteDataAs the mapData used in the snippet was a local variable, its scope has ended with the execution of postDataTask .The problem was that the strings in the dictionary that was set as a part of HTTPBody of NSMutableURLRequest still stays in the heap memory even after the task is done.Was able to dump the strings using below commands:Step 1 : Connect lldb debugger to device/simulatorStep 2 : Import => "script import lldb.macosx.heap"Step 3 : Search for strings "cstr_refs CSTRING "darkhorse"" after the NSURLSessionDataTask is done
Post marked as solved
8 Replies
UndoManager of text field saves the text entered for undo purpose.So incase if textfield is used.To completely remove the strings from the heap memory, along with replacing the text in the text field, undo manager should be disabled or removeAllActions of undoManager(after setting the text) should be executed on the TextField.[textField.undoManager removeAllActions];