【发布时间】:2010-11-09 22:09:20
【问题描述】:
我有数据对象类:
@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线程访问时出现错误。
【问题讨论】:
标签: objective-c cocoa memory zombie-process