我有一个application
,您在那里按下button
,当您按下按钮时,标签随机词变化。但是当我按下按钮我的label
消失。从数组中获取值并将其放在文本标签中
我该怎么办?
这是代码:
if (sender == self.button) {
NSString*path = [[NSBundle mainBundle]pathForResource:@"wordss" ofType:@"plist"];
words = [[NSMutableArray alloc]initWithContentsOfFile:path];
[self.randomLabel setText:[self.words objectAtIndex:arc4random_uniform([self.words count])]];
}
Tnx它的工作几乎只有标签显示数字而不是字符串。这怎么可能? – T1992
对不起,但我没有得到你。请澄清你想知道什么?请告诉我。 :) –
在words.plist中每个刺都有一个类似于项目o,项目1等的按键。当我按下按钮时,标签显示的是密钥而不是密钥的值 – T1992