2014-03-12 2 views
2

을 작동하지 않습니다 그래서 난 내 탐색 줄에 UIBarButtonItem이이 같은 RAC()를 사용하려면이 같은 도청 때 잡으려고RAC()와 .rac_command 함께

RAC(myButton, enabled) = [RACSignal 
    combineLatest:@[ RACObserve(self, password), RACObserve(self, passwordConfirmation) ] 
    reduce:^(NSString *password, NSString *passwordConfirm) { 
    return @([passwordConfirm isEqualToString:password]); 
    }]; 

뿐만 아니라 rac_command를 :

myButton.rac_command = [[RACCommand alloc] initWithSignalBlock:^RACSignal *(id input) { 
    // Do stuff 
    return [RACSignal empty]; 
}]; 

두 개를 결합하면 어설 션 오류가 발생합니다.

그래서 질문입니다 : 어떻게 RAC()와 rac_command를 함께 사용할 수 있습니까?

답변

3

대신 -[RACCommand initWithEnabled:signalBlock:]을 사용하십시오.

+0

나는 (질문을 게시 한 후에)이 사실을 발견했다. 나는 약 1 시간 만에 그것을 시도 할 것이고 받아 들여지는 당신의 대답을 표시 할 것이다 - 고마워! –

+0

감사합니다. –