- (void) tearDown
{
// tear-down code here
[super tearDown];
}
What is the functionality of tearDown here?
Does “tearDown” only used to release the memory?
or something else?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In general, tearDown should undo anything done in setUp.
As for releasing memory, tearDown could do that but that really should done as soon as possible (so in tearDown, it would release any memory initialized in setUp). If you initialize it in your test, it should be released in your test.