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 6001157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:47:44+00:00 2026-05-23T00:47:44+00:00

When I add an plists-file to my XCode project, my iPad app can’t seem

  • 0

When I add an plists-file to my XCode project, my iPad app can’t seem to read it.

For example: I have massCategories.plist inside my project’s folder (where the xproj-file lives). Inside my plist is the following code:

<?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>Item 1</key>
    <dict>
        <key>Key 1</key>
        <string>Value 1</string>
        <key>Key 2</key>
        <string>Value 2</string>
    </dict>
    <key>Item 2</key>
    <dict>
        <key>Key 3</key>
        <string>Value 3</string>
        <key>Key 4</key>
        <string>Value 4</string>
    </dict>
</dict>
</plist>

Inside my ViewController I have the following method:

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSBundle *mainBundle = [NSBundle mainBundle];
    NSString *plistData = [mainBundle pathForResource:@"MassCategories" ofType:@"plist"];
    NSArray *massCategories = [[NSArray alloc] initWithContentsOfFile:plistData];
    // breakpoint
}

When running (and “pausing” at the breakpoint), massCategories contains nil.
Adding the plist file to another folder doesn’t seem to work (or I must be using the wrong folders, which is well possible :-)).

Any suggestions?

  • 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-23T00:47:44+00:00Added an answer on May 23, 2026 at 12:47 am

    Got it!

    Just update the plist such that the main element is an array (just as I should’ve expected when trying to import it as an array):

    <?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">
    <array>
    ...
    </array>
    </plist>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can easily see how to add hierarchical data to a plist file via
I have a plist file with Title and Message keys. I want to add
I want to add a new dictionary to the existing plist file, how can
when i add new entries to my settings bundle root.plist file, build and run
I have a favorites plist file when I try to load it like this
I have a project with two Info.plist files (one for each target). In the
I have a .plist file that looks like this: <plist version=1.0> <array> <dict> <key>name</key>
An [ApplicationName]-Info.plist file is created with every new iPhone SDK project. My question: is
I am totally confused while using a plist file. Can anyone explain me the
My iphone app writes key-value pairs to a dictionary in a plist file. I'm

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.