여기에는 이러한 유형의 질문이 많지만 실현 가능한 답변을 찾을 수 없었습니다.중첩 사전 - 개별 키 지정
간단히 말해서 선택한 카테고리 내의 모든 제품에 대한 가격 배열을 가져와야합니다. 나는이 같은 계층 구조 내에서 깊은 타겟으로하는 방법을 몰라
<key>Product Category</key>
<dict>
<key>Product 1</key>
<dict>
<key>Image</key>
<string></string>
<key>Large Image</key>
<string></string>
<key>Detail</key>
<string></string>
<key>Price</key>
<integer>100</integer>
</dict>
<key>Product 2</key>
<dict>
<key>Image</key>
<string></string>
<key>Large Image</key>
<string></string>
<key>Detail</key>
<string></string>
<key>Price</key>
<integer>200</integer>
</dict>
</dict>
:
여기 내 PLIST입니다. 여기 내 시도는 지금까지입니다 :
NSString *detailPListPath = [[NSBundle mainBundle] pathForResource:@"detail" ofType:@"plist"];
NSDictionary *detailDictionary = [NSDictionary dictionaryWithContentsOfFile:detailPListPath];
currentDetail = [[NSMutableArray alloc] init];
for (id object in [detailDictionary objectForKey:indication]) {
[currentDetail addObject:object];
}
그러나 currentDetail
당신이 제공 할 수있는 어떤 도움 제품 1 등 제품이
감사를 보여줍니다!
당신은 나에게 해결책을 보여준 것이 아니라 깊은 사전에 액세스하는 방법에 대해 많이 가르쳐 주셨습니다. 건배 동료, 당신의 생명의 은인! –
당신은 오신 것을 환영합니다! 기꺼이 도와 드리겠습니다 :) – albertamg