Ios 当返回值的类型为CGFloat时,如何使用ReactiveCocoa发送KeyPath
错误日志为:Ios 当返回值的类型为CGFloat时,如何使用ReactiveCocoa发送KeyPath,ios,reactive-cocoa,reactive-cocoa-3,Ios,Reactive Cocoa,Reactive Cocoa 3,错误日志为: self.subscription = [[[RACObserve(photoModel, fullsizedData) filter:^BOOL(id value) { return value != nil; }]map:^id(id value) { return [NSNumber numberWithFloat:1.0f]; } ]setKeyPath:@keypath(self.image
self.subscription = [[[RACObserve(photoModel, fullsizedData) filter:^BOOL(id value) {
return value != nil;
}]map:^id(id value) {
return [NSNumber numberWithFloat:1.0f];
} ]setKeyPath:@keypath(self.imageView.layer,borderWidth)onObject:self.imageView];
由于未捕获异常“NSUnknownKeyException”而终止应用程序,
原因:'[setValue:forUndefinedKey:]:
此类不符合密钥半径的密钥值编码。
我认为如果有另一种方法来反应值的类型是float、int等等。我会接受它。你应该使用string而不是
@keypath
宏
Terminating app due to uncaught exception 'NSUnknownKeyException',
reason: '[<UIImageView 0x7b1a8510> setValue:forUndefinedKey:]:
this class is not key value coding-compliant for the key cornerRadius.
或者可以使用更清晰的RAC宏
[... setKeyPath:"layer.borderWidth" onObject:self.imageView];
您应该使用字符串而不是
@keypath
宏
Terminating app due to uncaught exception 'NSUnknownKeyException',
reason: '[<UIImageView 0x7b1a8510> setValue:forUndefinedKey:]:
this class is not key value coding-compliant for the key cornerRadius.
或者可以使用更清晰的RAC宏
[... setKeyPath:"layer.borderWidth" onObject:self.imageView];
您应该使用字符串而不是
@keypath
宏
Terminating app due to uncaught exception 'NSUnknownKeyException',
reason: '[<UIImageView 0x7b1a8510> setValue:forUndefinedKey:]:
this class is not key value coding-compliant for the key cornerRadius.
或者可以使用更清晰的RAC宏
[... setKeyPath:"layer.borderWidth" onObject:self.imageView];
您应该使用字符串而不是
@keypath
宏
Terminating app due to uncaught exception 'NSUnknownKeyException',
reason: '[<UIImageView 0x7b1a8510> setValue:forUndefinedKey:]:
this class is not key value coding-compliant for the key cornerRadius.
或者可以使用更清晰的RAC宏
[... setKeyPath:"layer.borderWidth" onObject:self.imageView];
它不应该是@keypath(self.imageView,layer.borderWidth)?它不应该是@keypath(self.imageView,layer.borderWidth)?它不应该是@keypath(self.imageView,layer.borderWidth)?你也可以使用信号操作符去掉所有的块:
[[RACObserve](photoModel,fullsizedData]ignore:nil]maprelace:@1.0f]
您还可以使用信号操作符除去所有块:[[RACObserve(photoModel,fullsizedData]ignore:nil]maprelace:@1.0f]
您还可以使用信号操作符除去所有块:[[RACObserve(photoModel,fullsizedData]ignore:nil]mapReplace:@1.0f]
您还可以使用信号操作符清除所有块:[[RACObserve(photoModel,fullsizedData]ignore:nil]mapReplace:@1.0f]