-(void)_test4{ ///RAC combineLatest和merge // combineLatest只有当两个信号都发送了 订阅者才能收到信息 结果一次收到 结果是数组 // merge只要有一个发送了就能收到 结果一条一条收到 // RACSubject *baseSubjectTwo = [RACSubject subject]; // RACSubject *baseSignal = [RACSubject subject]; // [[RACSignal combineLatest:@[baseSignal,baseSubjectTwo]]subscribeNext:^(id x) { // NSLog(@"接收到两个信号发来的信息%@",x); // }]; // // [baseSignal sendNext:@"baseSignal发送了信号"]; // [baseSubjectTwo sendNext:@"baseSubjectTwo发送了信号"]; RACSubject *baseSubject4 = [RACSubject subject]; RACSubject *baseSignal3 = [RACSubject subject]; [[RACSignal merge:@[baseSignal3,baseSubject4]]subscribeNext:^(id x) { NSLog(@"接收到3,4信号发来的信息%@",x); }]; [baseSignal3 sendNext:@"baseSignal3发送了信号"]; [baseSubject4 sendNext:@"baseSubject4发送了信号"]; }