次のコードを使用してNSMutableDictionaryを参照しています
NSMutableDictionary *item;
for (item in menuArray) {
BSThirdLayerViewController *nextLayer = [[BSThirdLayerViewController alloc] initWithStyle:UITableViewStylePlain];
nextLayer.title = [item valueForKey:@"title"];
nextLayer.rowImage = [item valueForKey:@"image"];
[array addObject:nextLayer];
}
辞書は次のplistファイルからロードされます。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Item 0</key>
<dict>
<key>title</key>
<string>East Coast</string>
</dict>
<key>Item 1</key>
<dict>
<key>title</key>
<string>West Coast</string>
</dict>
<key>Item 2</key>
<dict>
<key>title</key>
<string>South Rhodes</string>
</dict>
</dict>
</plist>
for-inループ中にitem変数はどのような種類のデータを持ちますか?アクセスしようとするとプログラムがクラッシュする
[item valueForKey:@"title"];
論理的に思えますが、何が起こっているのでしょうか。
お時間をいただきありがとうございます。