Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6105257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:57:25+00:00 2026-05-23T13:57:25+00:00

another fun (and probably really simple) question for you, that I have half worked

  • 0

another fun (and probably really simple) question for you, that I have half worked out and now run into a dead end…

I need to build an indexed table using data from a plist which looks something like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Categories</key>
    <array>
        <dict>
            <key>CategoryName</key>
            <string>Test Category</string>
            <key>CategoryID</key>
            <integer>10</integer>
            <key>Sections</key>
            <dict>
                <key>A</key>
                <array>
                    <string>A Jones</string>
                    <string>A King</string>
                </array>
                <key>T</key>
                <array>
                    <string>T Jones</string>
                    <string>T King</string>
                </array>
            </dict>
        </dict>
        <dict>
            <key>CategoryName</key>
            <string>Another Test Category</string>
            <key>CategoryID</key>
            <integer>20</integer>
            <key>Sections</key>
            <dict>
                <key>P</key>
                <array>
                    <string>P Jones</string>
                    <string>P King</string>
                </array>
                <key>S</key>
                <array>
                    <string>S Jones</string>
                    <string>S King</string>
                </array>
            </dict>
        </dict>
    </array>
</dict>

So, what I need help with is how to get the people in each section depending on the required CategoryID. I think the main problem for me is, how do I determine which CategoryID to pull info out of (ie I know the CategoryID, but how do I relate this to the correct section) and then how do i loop through each section key (a, b, c etc..) when the key is the name of the section (does that make sense?).

Any help and thoughts are greatly appreciated! Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:57:25+00:00Added an answer on May 23, 2026 at 1:57 pm
    NSDictionary *myDictionary = //load your dictionary from the file here
    NSArray *categoryArray = [myDictionary objectForKey:@"Categories"];
    
    NSDictionary *neededCategory;
    for (NSDictionary *category in categoryArray) {
         NSNumber *categoryID = (NSNumber *)[category objectForKey @"CategoryID"];
         if ([categoryID intValue] == neededCategoryID) {
              neededCategory = category;
              break;
         }
    }
    
    //Sections
    NSDictionary *sections = [neededCategory objectForKey:@"Sections"];
    NSArray *allSectionKeys = [sections allKeys];
    
    for (NSString *key in allSectionKeys) {
       NSArray *name = [sections objectForKey:key];
       //Do something with the name here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Another basic Rails question: I have a database table that needs to contain references
Another simple question from silly old me. We keep hearing big numbers being thrown
I have this function: def fun(arg1=1, arg2=2, arg3=3, arg4=4) Now if I want to
Yes another question that is a little Unique because I cant find the same
Here's one that's sure to be fun for someone. So I have an array
Another easy one hopefully. Let's say I have a collection like this: List<DateTime> allDates;
Another poster asked about preferred syntax for infinite loops . A follow-up question: Why
Another question asked about determining odd/evenness in C, and the idiomatic (x & 1)
another request sorry.. Right now I am reading the tokens in one by one
In another question I posted yesterday, I got very good advice on how a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.