iOS 메모리 부족 (memory warning)테스트 방법

냠냠·2024년 9월 27일
0

iOS

목록 보기
8/9
post-thumbnail

iOS 앱을 개발하다보면 메모리 부족 테스트를 해야할때가 있다.
Simulator 의 경우 Debug > Simulate Memory Warning 을 이용해서 쉽게 테스트가 가능하지만 시뮬레이터에서 실행을 할 수 없는 앱도 많다.

[[UIApplication sharedApplication] performSelector:@selector(_performMemoryWarning)];

이럴때는 위 코드를 적절한 곳에서 호출해서 실제 기기에서 테스트 하면 된다.

출처 : StackOverflow - iOS Development: How can I induce low memory warnings on device?

0개의 댓글