同时重写getter setter方法时,需使用关键字@synthesize

@synthesize quickReplies = _quickReplies;
- (NSMutableArray *)quickReplies
{
    if (_quickReplies == nil) {
        _quickReplies = [NSMutableArray array];   
    }
    return _quickReplies;
}

- (void)setQuickReplies:(NSMutableArray *)quickReplies
{
    _quickReplies = quickReplies;
    self.countLabel.richText = [NSString stringWithFormat:@"%lu/200", (5 -self.quickReplies.count)];
}

你可能感兴趣的:(同时重写getter setter方法时,需使用关键字@synthesize)