My program is running by 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];
}
});
}
problem is still running when I dismissModalViewController
.
I want to quit these back threads when I touch back button.
-(void) BackButtonPressed:(id)sender
{
[self dismissModalViewControllerAnimated:YES];
}
How do I add codes?