我的plist文件如下所示:
<dict>
<key>subject 1</key>
<dict>
<key>chapter 1</key>
<array>
item 1
item 2
.
.
</array>
<key>chapter 2</key>
.
.
</dict>
<key>subject 2</key>
.
.
我怎样才能展示主题&amp;章节有关手风琴风格table-view
的信息,并在detail-view
?
答案 0 :(得分:0)
尝试此解决方案,如果您有任何疑问,请告诉我。
-(NSArray *)Data
{
plistPath = [[NSBundle mainBundle] pathForResource:@"PlistName" ofType:@"plist"];
NSMutableDictionary * propertyDict = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath];
NSMutableDictionary *Key = [propertyDict objectForKey:@"subject 1"];
NSArray *Chapter =(NSArray *) [Key objectForKey:@"chapter 1"];
return Chapter;
}