我UIButton
添加了一个视图。我的视图也有三个文本框,即。用户名、密码和确认密码。基于这些文本框的合法内容,我需要启用我的注册按钮。
这是我的代码片段:-
UIButton *signUp = [[UIButton alloc]initWithFrame:CGRectMake(10, 100, 50, 20)];
signUp.backgroundColor = [UIColor greenColor];
signUp.enabled = NO ;
[self.view addSubview:signUp];
RACSignal *formValid = [RACSignal
combineLatest:@[
username.rac_textSignal,
password.rac_textSignal,
confirmPassword.rac_textSignal
]
reduce:^(NSString *username, NSString *password, NSString *passwordVerification) {
return @([username length] > 0 && [password length] > 8 && [password isEqual:passwordVerification]);
}];
RAC(signUp.enabled) = formValid; //Error is here
在最后一行,我收到两个错误:-
- ARC不允许将'BOOL'(又名'signed char')隐式转换为'id'
- 预期标识符
我是 Reactive Cocoa 的新手。请忽略错误。