首先创建一个标签,通过标签值的变化来看这个线程的特性
UILabel *bel = [[UILabel alloc] initWithFrame:CGRectMake(20, 100, 100, 50)];
bel.backgroundColor = [UIColor redColor];
bel.text = @"TSET";
[self.view addSubview:bel];
第一段代码
dispatch_async(dispatch_get_main_queue(), ^{
NSInteger i=1;
while (i) {
usleep(30*1000);
NSLog(@"%ld",i);
i++;