同时重写getter setter方法时,需使用关键字@synt
2016-12-13 本文已影响8人
蓝色的雪啦
@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)];
}