Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First of all this line</p> <pre><code>NSString *path = [documentsDirectory stringByAppendingPathComponent:@"instellingen.plist"]; ? </code></pre> <p>should be</p> <pre><code>NSString *path = [documentsDirectory stringByAppendingPathComponent:@"settings.plist"]; </code></pre> <p>I also had to delete these from the dictionary:</p> <pre><code>&lt;--catagorydata &lt;-- questiondata </code></pre> <p>Besides the two things above, there is nothing wrong with your code or your dictionary.<br> After making those changes I tested your code and the output I got was:</p> <pre><code>tester[69637:c07] size of dict 3 tester[69637:c07] count: 8 </code></pre> <p>which is correct according to the .plist file </p> <p>So your problem is at the first 4 lines. Make sure your file is in Documents directory (use something like the following code to see whats going wrong)</p> <pre><code> NSLog(@"Path : %@",path); </code></pre> <p>I copied the file in the project folder (because I used the simulator) and used the following code and everything worked fine</p> <pre><code>NSBundle* b=[NSBundle mainBundle]; NSURL* path1=[b URLForResource:@"settings" withExtension:@"plist"]; NSMutableDictionary *instellingen = [NSMutableDictionary dictionaryWithContentsOfURL:path1]; NSLog(@"size of dict %d",[instellingen count]); NSArray *vragen = [instellingen objectForKey:@"vragen"]; NSArray *cata = [vragen objectAtIndex: 0]; NSArray *question = [cata objectAtIndex: 0]; NSLog(@"count: %i", [question count]); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload