我使用的按钮在栏显示字母,现在这是我使用的代码
-(IBAction) clicked: (id)sender{
NSString *titleOfButton = [sender titleForState:UIControlStateNormal];
NSString *newLabelText = titleOfButton;
labelsText.text = [NSString stringWithFormat:@"%@%@", labelsText.text, newLabelText];
//if ([newLabelText length] >= 5) newLabelText = [newLabelText substringToIndex:5];
}
我的问题是,我希望它能够把5个字母最多是否有任何人谁可以告诉我如何做到这一点?
谢谢