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

The Archive Base Latest Questions

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

I am currently using NSPredicate to search if a certain key has a certain

  • 0

I am currently using NSPredicate to search if a certain key has a certain value in plist, if it matches, I want it to display one of the values in the dictionary, not the entire dictionary, but the way I am using NSPredicate returns me the whole dictionary of items. May I know how to do that?

Let’s say my plist looks like this:

    Root (Array)
     Item 0 (Dictionary)
          Name (String)
          Number (String)
          Address (Dictionary)
               First Address (Array)
                    Item 0 (Dictionary)
                         Block (String)            Value: 1234
                         Postal Code (String)
                         Unit Number (String)
                         Street Name (String)      Value: King Street
               Second Address (Array)
                        Item 1 (Dictionary)
                         Block (String)
                         Postal Code (String)
                         Unit Number (String)
                         Street Name (String)
     Item 1 (Dictionary)
          and so on...

My NSPredicate goes like this:

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"Block == '1234'"];
NSArray *predicateArray = [blockStage filteredArrayUsingPredicate:predicate];

The NSPredicate returns me all the values in Item 0, but I want to only display the value of “Street Name”, which is “King Street”. How do I go about doing that???

Many 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-25T12:46:23+00:00Added an answer on May 25, 2026 at 12:46 pm

    Your fetch request will return all objects from the initial array that match your predicate. So if your initial array contains objects at the level of Item 0, this is what is returned.

    If you only want to display the street name afterwards then you will need to pick this out of the returned object(s) using whatever objectForKey statements are necessary. You’ll probably need some additional logic to determine which address (first or second) matches your predicate, since the keys are the same.

    If your keys are really as described in the plist example above, these are not key value coding compliant. See Key-Value Coding Fundamentals for details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently using Oracle/BEA/Plumtree ALUI Portal 6.1, and am trying to display a client's IP
Im currently using CodeIgniters active record class to UPDATE a MySQL table. One of
Im currently using the JQuery UI extension for its search autocomplete. However, I need
Currently using wxHTML to display a remote web page in a C++ Windows wxWidgets
Currently using cocos2d. I have a plist data name myplist.plist. Inside the plist are
Im currently using base64_encode for some $_GET params that i don't want regular user
Im currently using Apache behind an Nginx Proxy which really works fine with one
I am presenting table view contents using NSFetchedResultsController which has a predicate: [NSPredicate predicateWithFormat:@visible
currently using spring 'exposedContextBeanNames' to allow me to display properties in my view but
Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control. We have licenses for Telerik. I

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.