thread about

1.转载 

[NSThread detachNewThreadSelector:@selector(delTargetBook) toTarget:self withObject:nil];


-(void)delTargetBook
{
NSAutoreleasePool *pool =[[NSAutoreleasePool alloc] init];
        //代码部分

        //代码部分
        //回主线程执行
[self performSelectorOnMainThread:@selector(didDelTargetBook) withObject:nil waitUntilDone:NO];
[pool release];
}

-(void)didDelTargetBook
{
[MBProgressHUD hideHUDForView:self animated:YES];
if ([delegate_ respondsToSelector:@selector(btnOfLibraryBookWasDelete:)]) {
[delegate_ btnOfLibraryBookWasDelete:self];
}
}
posted @ 2011-07-14 08:51  HA-LOU  阅读(206)  评论(0编辑  收藏  举报