0
검색을 구현했으며 사용자가 입력 한 모든 새로운 문자에 대해 performFetch:
이 performBlock:
내부에서 시작되었습니다. 검색 문자열이 변경되면 이전 시작 블록을 취소하고 다시 시작하고 싶습니다. 어떻게 내가 그 블록에 대해 performBlock:
안에있는 블록을 취소하거나 알릴 수 있습니까? 내가 지금이performBlock 취소 방법 :
예제 코드 :
[myManagedObjectContext performBlock:^{
// fetch from background queue
if([[self fetchedResultsController] performFetch:nil]) {
// update the view from the main queue
// don't do this if performBlock already got started again! but how?
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
// refresh UI
}];
}
}];
이 간단하고 명확한 답변에 감사드립니다. 'NSAsynchronousFetchRequest'는 좋은 해결책처럼 보입니다. –