I have data object class:
@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
I can set the title
property just fine when using non-synthesized methods, but when I set a property with synthesized accessors I get an error in the updateText
method on the line that reads:
self.text=@"new text";
The error is:
*** 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
Why do identical non-synthesized accessors work and synthesized ones don't?
The object is created in main thread and Error appears when it's accessed from NSOperation thread.