私のプログラムは gcd で実行されています。
-(void) viewdidLoad {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH,0),
^ {
for(int i=0; i<screenshotNum ; i++)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString * url=[detailItem.mScreenshot objectAtIndex:i];
NSDictionary *args=[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:i], @"screenNum",
[NSString stringWithString:url],@"url",
nil];
[self loadImageScreenshot:args];
[pool release];
}
});
}
問題はまだ実行されていdismissModalViewController
ます。
戻るボタンをタッチしたときにこれらのバックスレッドを終了したい。
-(void) BackButtonPressed:(id)sender
{
[self dismissModalViewControllerAnimated:YES];
}
コードを追加するにはどうすればよいですか?