天天看點

iPhone線程的使用

//線程的建立方式

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

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

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

//要線上程中做的事

  [pool release];

}