iOS 앱을 작성하고 imageStore 라이브러리를 사용하여 이미지를 지연로드하고 메모리에 캐시합니다.iOS 호출 방법 앞에 대리자가 있는지 확인하십시오.
imageStore = [ImageStore new];
imageStore.delegate = self;
이미지가 reloadData을하고 있음을
- (void)imageStoreDidGetNewImage:(ImageStore*)sender url:(NSString*)url
imagestore 통화 위임 방법, successfuly로드 할 때 : (https://github.com/psychs/imagestore)는
의 ViewController에나는 imagestore 인스턴스를 생성 tableview에서 셀을 다시 그리기. 모두 잘 작동합니다. 하지만 거기에 문제가 : ViewController didUnload (네비게이션 컨트롤러로 돌아 가기) 및 이미지가로드 된 경우, 응용 프로그램이 무인 ViewController의 imagestore 메서드를 호출하기 때문에 충돌로 종료됩니다.
내가 다음을 수행하십시오 : 1)의 ViewController에서 나는 viewDidUnload 섹션에서이 코드를 배치 :
imageStore.delegate = nil;
imageStore = nil;
2) imageStore에서 내가 전무 검사 추가 된 : 그것은 작동
if(delegate != nil) {
...call delegate method
}
을, 어쨌든 정기적으로 앱이 다운됩니다.
'2)'는 불필요합니다. 메시지는'nil' 객체에 안전하게 보낼 수 있습니다. – Nekto
답변 해 주셔서 감사합니다! 이미지로드 및 viewcontroller 언로드 경우 충돌없이 100 % ... –