OC + RAC(七) RACSubject和RACSignal的區別

-(void)_test8{ /// RACSubject繼承自RACSignal 可是RACSubject和RACSignal的區別?
    //1能接收1,2 //可是2只能接收2
    RACSubject *subject = [RACSubject subject]; [subject subscribeNext:^(id x) { NSLog(@"訂閱者1%@", x); }]; [subject sendNext:@"subject1"]; [subject subscribeNext:^(id x) { NSLog(@"訂閱者2%@", x); }]; [subject sendNext:@"subject2"]; }
相關文章
相關標籤/搜索