在我的模型中,我有一个通知属性,负责更新控制器,如果我有匹配的卡片或卡片不匹配。因此,在检查匹配(模型)后,我获得了比赛的2张卡的方法我写这行:当试图发送stringWithFormat到NSString时发出警告
self.notification = [NSString stringWithFormat:@"%@ matched to %@", card.contents, otherCard.contents];
通知只读属性。
@property (readonly, nonatomic) NSString *notification;
答控制器心中已经写了这行:
self.notificationLabel.text = [NSString stringWithFormat:self.game.notification];
现在,它完美的作品,但我得到一个警告:
format string is not a string literal (potentially insecure), why is that?
这里有很多重复的,实际上:http://stackoverflow.com/search?q=format+string+is+not+literal+%5Bobjective-c%5D – 2013-03-12 00:10:18