Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing nested NSDictionary with Picker
    primarykey
    data
    text
    <p>Newbie here,</p> <p>I have a single component picker set up from a plist, with each item being an array, with multiple strings in each array that the app uses.</p> <p>Currently the plist structure is like this:</p> <pre><code>NSDictionary -&gt; NSArray -&gt; NSString | | Items in Picker Data for each Item </code></pre> <p>But now, I want:</p> <pre><code>NSDictionary -&gt; NSDictionary -&gt; NSArray -&gt; NSString | | | DIfferent Picker Data Sets Items in Picker Data for each Item </code></pre> <p>So now there would be multiple sets of picker components that I would show using a segmented control etc...</p> <p>I'm not even sure if this is possible, and I was only hoping it would save me from making many different separate picker controllers.</p> <p>What has me stumped is just getting everything ingested properly</p> <p>This is what I have now, it builds successfully but crashes (debug info below):</p> <pre><code>NSBundle *bundle = [NSBundle mainBundle]; NSString *plistPath = [bundle pathForResource:@"CamerasDatabase" ofType:@"plist"]; NSDictionary *dictionary = [[NSDictionary alloc] initWithContentsOfFile:plistPath]; self.allCameras = dictionary; [dictionary release]; NSArray *cameraTypes = [self.allCameras allKeys]; self.CamTypes = cameraTypes; NSArray *items = [self.CamTypes objectAtIndex:0]; self.Cameras = items; NSString *selectedCamera = [self.Cameras objectAtIndex:0]; NSArray *array = [CamsList objectForKey:selectedCam]; self.cameraData = array; </code></pre> <p>I've tried many different combinations of dictionaries, arrays, and strings so I'm sure the above code is messed up.</p> <p>It crashes at:</p> <pre><code>NSString *selectedCamera = [self.Cameras objectAtIndex:0]; </code></pre> <p>with "-[NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x4e127f0"</p>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    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