데이터 객체 클래스가 있습니다.자기 자신이있는 속성에 액세스 할 때 내 프로그램이 중단되는 이유는 무엇입니까? 및 합성 접근?
@interface Item: NSObject {
NSString *title;
NSString *text;
}
@property (copy) NSString *title;
@property (copy) NSString *text;
@end
@implementation Item
@synthesize text;
- (void)updateText {
[email protected]"new text";
}
- (NSString *)title {
return title;
}
- (void)setTitle:(NSString *)aString {
[title release];
title = [aString copy];
}
@end
비 합성 메서드를 사용할 때
title
속성을 올바르게 설정할 수 있지만 합성 된 접근 자로 속성을 설정하면
updateText
메서드에서 오류가 발생합니다. 읽습니다 :
[email protected]"new text";
오류 :
*** NSInvocation: warning: object 0x462d2c0 of class '_NSZombie_CFString' does not implement methodSignatureForSelector: -- trouble ahead
*** NSInvocation: warning: object 0x462d2c0 of class '_NSZombie_CFString' does not implement doesNotRecognizeSelector: -- abort
동일한 합성되지 않은 접근자는 작동하고 합성되지 않는 이유는 무엇입니까?
개체가 주 스레드에서 만들어지고 NSOperation 스레드에서 액세스 할 때 오류가 나타납니다.
개체가 주 스레드에서 만들어지고 NSOperation 스레드에서 액세스 할 때 오류가 나타납니다. – Rod