简单实用两种方法来事项我们需要的线程之间的数据交换

来源:互联网 发布:苹果映客主播笑声软件 编辑:程序博客网 时间:2024/04/29 17:26
    线程间通信常用方法:
    
    // 最后一个参数:是否等待调用方法执行结束!
    <1>[self performSelectorOnMainThread:@selector(setImageWithImage:) withObject:nil waitUntilDone:YES];
    
    <2>[self performSelector:@selector(setImageWithImage:) onThread:[NSThread mainThread] withObject:nil waitUntilDone:YES];
0 0
原创粉丝点击