Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Week 1] super.tearDown() 호출 순서 #2

Open
hope1053 opened this issue Sep 24, 2022 · 0 comments
Open

[Week 1] super.tearDown() 호출 순서 #2

hope1053 opened this issue Sep 24, 2022 · 0 comments

Comments

@hope1053
Copy link
Member

제목

super.tearDown() 호출 순서

궁금한점

tearDown은 왜 항상 super method를 마지막에 호출해야할까?

찾아본 것

https://coderanch.com/t/445846/engineering/super-teardown

If the superclass needs to tearDown something, it is good practice to call it. This method is called last in case the current class is relying on something that might be nulled out or cleaned up in the superclass.

(이때 super.tearDown은 XCTest의 tearDown)

super.tearDown()은 XCTestCase superclass가 tearDown해야할 때 쓰는 메서드.
현재 클래스가 super class에서 null이 되거나 지워질 수 있는 무언가에 의존하고 있을 때 해당 슈퍼 메서드는 마지막에 불려야함

https://stackoverflow.com/questions/53448538/xcode-10-and-super-teardown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant