1

my plist file looks like below:

<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>

             .
             .

how can i show subjects & chapters information on a accordion style table-view and show the items in the detail-view ?

The Hungry Dictator
  • 3,444
  • 5
  • 37
  • 53
  • possible duplicate of [Read/write data from a plist of dictionaries and arrays, and load different levels into a TableView](http://stackoverflow.com/questions/21978626/read-write-data-from-a-plist-of-dictionaries-and-arrays-and-load-different-leve) – Balram Tiwari Feb 25 '14 at 04:37

1 Answers1

0

Try This Solution and Let Me know if you have any doubts.

 -(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;
    }
Peer Mohamed Thabib
  • 636
  • 2
  • 9
  • 29