다음은 내 프로그램의 일부입니다. findDuplicates의 루프는 버튼을 누른 후 백그라운드 스레드에서 시작됩니다. 다른 버튼을 눌러 스레드/루프를 중지/종료 할 수있는 방법이 있습니까? 스레드을 종료 에서루프/스레드 종료 방법
Threading Programming Guide에서 읽기- (IBAction)countDups:(id)sender {
[self performSelectorInBackground:@selector(findDuplicates) withObject:nil];
}
-(void)findDuplicates
{
...
for(int index=0;index<self.resultList.count;index++)
{ ... }
...
}