NSOperation
来源:互联网 发布:在线教育 java源码 编辑:程序博客网 时间:2024/05/21 08:40
#import "ViewController.h"@interface ViewController ()@end@implementation ViewController-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ [self blockOperation];}-(void)blockOperation{ NSBlockOperation *op1=[NSBlockOperation blockOperationWithBlock:^{ NSLog(@"%s---------%@",__func__,[NSThread currentThread]); }]; NSBlockOperation *op2=[NSBlockOperation blockOperationWithBlock:^{ NSLog(@"%s---------%@",__func__,[NSThread currentThread]); }]; NSBlockOperation *op3=[NSBlockOperation blockOperationWithBlock:^{ NSLog(@"%s---------%@",__func__,[NSThread currentThread]); }]; [op1 start]; [op2 start]; [op3 start];}-(void)invocationOperation{ /* 参数1:目标对象 self 参数2:调用的方法的名称 参数3:参数 */ NSInvocationOperation *op1=[[NSInvocationOperation alloc]initWithTarget:self selector:@selector(downLoad1) object:nil]; //启动 [op1 start];}-(void)downLoad1{ NSLog(@"%s---------%@",__func__,[NSThread currentThread]);}@end
0 0
- NSOperation
- NsOperation
- NSOperation
- NSOperation
- NSOperation
- NSOperation
- NSOperation
- NSOperation
- NSOperation
- NSOperation
- NSOperation
- NSOperation
- NSOperation
- NSOperation
- NSOperation
- NSOperation
- NSOperation
- NSOperation
- 当出现no changes added to commit时如何正确使用git提交命令
- SQL SERVER 转换大小写
- Python sys模块的常用方法
- 1019. General Palindromic Number (20)
- PHP的性能杂谈
- NSOperation
- Java实现括号匹配校验
- JDBC操作数据库
- 较简单的修改和添加功能(链接数据库)
- 洛谷 P1037 产生数 弗洛伊德和高精度
- linux 网络编程
- 经典线程同步互斥问题在windows下的各种解法
- RadioGroup用法
- Swift3.0 GCD定时器的使用,实现倒计时,UIDatePicker的使用, 仿写一个活动倒计时的DEMO