私はデータオブジェクトクラスを持っています:
@interface Item: NSObject {
NSString *title;
NSString *text;
}
@property (copy) NSString *title;
@property (copy) NSString *text;
@end
@implementation Item
@synthesize text;
- (void)updateText {
self.text=@"new text";
}
- (NSString *)title {
return title;
}
- (void)setTitle:(NSString *)aString {
[title release];
title = [aString copy];
}
@end
title
合成されていないメソッドを使用する場合はプロパティを問題なく設定できますが、合成されたアクセサーを使用してプロパティを設定するとupdateText
、次の行のメソッドでエラーが発生します。
self.text=@"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 スレッドからアクセスするとエラーが発生します。