我有一个文本标签,当我按下按钮时会改变,标签确实会随着数组的使用而改变,但是我得到的不是数组的值,而是数组的键。
我应该怎么做才能获得价值?
这是代码:
NSString*path = [[NSBundle mainBundle]pathForResource:@"words" ofType:@"plist"];
words = [[NSMutableArray alloc]initWithContentsOfFile:path];
NSString*generateRandomLabel =[NSString stringWithFormat:@"%d", arc4random_uniform([ words count])];
[self.randomLabel setText:generateRandomLabel];