Skip to content

Instantly share code, notes, and snippets.

@Coneko
Last active December 19, 2015 02:38
Show Gist options
  • Save Coneko/5884356 to your computer and use it in GitHub Desktop.
Save Coneko/5884356 to your computer and use it in GitHub Desktop.
[<Test 0x1002120d0> setNilValueForKey]: could not set nil as the value for the key primitive.
#import <Foundation/Foundation.h>
#import <ReactiveCocoa/ReactiveCocoa.h>
@interface Test : NSObject
@property (nonatomic, strong) Test *object;
@property (nonatomic) NSUInteger primitive;
@end
@implementation Test
@end
@interface Main : NSObject
- (void)main;
@end
@implementation Main
- (void)main {
Test *source = [[Test alloc] init];
source.object = [[Test alloc] init];
Test *destination = [[Test alloc] init];
destination.object = [[Test alloc] init];
[RACAble(source, object.primitive) toProperty:@keypath(destination, object.primitive) onObject:destination];
source.object = nil;
}
@end
int main(int argc, const char * argv[])
{
@autoreleasepool {
Main *main = [[Main alloc] init];
[main main];
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment