iPhone线程的使用

 

//线程的创建方式

[NSThread detachNewThreadSelector:@selector(getUserInfo:) toTarget:self withObject:xxx];

 

- (void)getUserInfo:(NSString *)uid {

  NSAutoreleasepool *pool = [[NSAutoreleasepool alloc] init];

//要在线程中做的事

  [pool release];

}

猜你喜欢

转载自374016526.iteye.com/blog/1156867