이 managedObject
하위 클래스가 있습니다. 위치는 NSPoint입니다. XIB에서 나는이NSPoint가 포함 된 NSValue에 바인딩 문제가 발생했습니다.
하나 개의 디스플레이 position.x 값과 다른 디스플레이 position.y 같은 두 NSTextField있는 원한다. 나는이 오류 : 그래서 내가 확인
[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key x.
을 얻을 "selection.position.x"와
프레임
관리중인 NSArrayController의 "selection.position.y"키 패스로 NSTextField있는 바인딩을 시도 KVC는 :-(void)awakeFromInsert
{
[super awakeFromInsert];
self.position = [NSValue valueWithPoint:NSPointFromCGPoint(CGPointZero)];
//[self.position setValue:[NSNumber numberWithFloat:50.0f] forKey:@"x"];
[self setValue:[NSNumber numberWithFloat:1.0f] forKeyPath:@"scale"];
[self setValue:[NSNumber numberWithFloat:10.0f] forKeyPath:@"frame.origin.x"];
[self setValue:[NSNumber numberWithFloat:10.0f] forKeyPath:@"position.x"];
}
첫 번째와 S : -(void)awakeFromInsert
에서
Frame.h
@interface Frame : NSManagedObject {
@private
}
@property (nonatomic, retain) NSNumber * order;
@property (nonatomic, retain) NSNumber *visible;
@property (nonatomic, retain) NSValue *position;
@property (nonatomic, retain) NSNumber *scale;
@property (nonatomic, retain) Sprite *sprite;
@property (nonatomic, retain) Resource *resource;
//test
@property (nonatomic, retain) NSValue *frame;
@end
나는이 코드를 시도 econd KVC setValue 작품, 위의 같은 메시지와 함께 세 번째 충돌
[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key x.
나는 왜, 어떤 도움을 주셔서 감사합니다 이해가 안돼.