わかりました、私はこのようなplistを持っています
`
<dict>
<key>Rows</key>
<array>
<dict>
<key>WireSize</key>
<string>16 AWG</string>
<key>Children</key>
<array>
<dict>
<key>Cooper 60°C (140°F)</key>
<string>0</string>
</dict>
<dict>
<key>Cooper 75°C (167°F)</key>
<string>0</string>
</dict>
<dict>
<key>Cooper 90°C (194°F)</key>
<string>14</string>
</dict>
<dict>
<key>Aluminum 60°C (140°F)</key>
<string>0</string>
</dict>
<dict>
<key>Aluminum 75°C (167°F)</key>
<string>0</string>
</dict>
<dict>
<key>Aluminum 90°C (194°F)</key>
<string>0</string>
</dict>
</array>
</dict>
<dict>
<key>WireSize</key>
<string>16 AWG</string>
<key>Children</key>
<array>
<dict>
<key>Cooper 60°C (140°F)</key>
<string>0</string>
</dict>
<dict>
<key>Cooper 75°C (167°F)</key>
<string>0</string>
</dict>
<dict>
<key>Cooper 90°C (194°F)</key>
<string>14</string>
</dict>
<dict>
<key>Aluminum 60°C (140°F)</key>
<string>0</string>
</dict>
<dict>
<key>Aluminum 75°C (167°F)</key>
<string>0</string>
</dict>
<dict>
<key>Aluminum 90°C (194°F)</key>
<string>0</string>
</dict>
</array>
</dict>
</array>
`
そこから値を読み取ろうとしましたが、成功しませんでした
私はこのコードを使用しています
enter NSBundle *bundle = [NSBundle mainBundle];
NSString *plistPath = [bundle pathForResource:@"Table 310-16" ofType:@"plist"];
NSDictionary *dictionary = [[NSDictionary alloc] initWithContentsOfFile:plistPath];
for (id key in dictionary) {
NSArray *array = [dictionary objectForKey:key];
NSLog(@"key: %@, value: %@", key, [array objectAtIndex:0]);
} here
結果は
key: Rows, value: {
Children = (
{
"Cooper 60\U00b0C (140\U00b0F)" = 0;
},
{
"Cooper 75\U00b0C (167\U00b0F)" = 0;
},
{
"Cooper 90\U00b0C (194\U00b0F)" = 14;
},
{
"Aluminum 60\U00b0C (140\U00b0F)" = 0;
},
{
"Aluminum 75\U00b0C (167\U00b0F)" = 0;
},
{
"Aluminum 90\U00b0C (194\U00b0F)" = 0;
}
);
WireSize = "16 AWG";
}
しかし、アルミニウム60°C(140°F)または14 または16 AWGなどの特定の値を取得する方法と特定の値はまだわかりません 。
HP