ランダムな plist 文字列を表示しようとしていますが、NSLog を実行すると、表示されるのはすべて '(null)' である可能性があります。
- (void) viewDidLoad
{
NSString *path = [[NSBundle mainBundle] pathForResource:
@"small" ofType:@"plist"];
NSDictionary *plistDict = [[NSDictionary alloc] initWithContentsOfFile:path];
NSMutableArray *plistArray = plistDict[@"Value"];
NSInteger randV = arc4random_uniform(plistArray.count); // randV is from 0 to number of strings -1 in array
[super viewDidLoad];
self.correctWord = [plistArray objectAtIndex:randV];
[self setupHangmanWord:self.correctWord];
}
これは私のsmall.plistファイルです: 画像
どんな助けでも素晴らしいでしょう..ありがとう