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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:07:20+00:00 2026-06-01T04:07:20+00:00

Hello frnds actually i have a array of arrays as given below:-` parrent array{

  • 0

Hello frnds actually i have a array of arrays as given below:-`

parrent array{
    PrArr =       

(

            {
                dt = "01-Apr-2012 11:15 PM\n";
                dur = "15\n\t\t";
                name = "Tez Special\n\t\t";
            },
                        {
                dt = "01-Apr-2012 11:30 PM\n\n";
                dur = "30\n\t\t";
                name = "Tez Tare\n\t\t";
            }
        );
        sid = "530\n";
    },

        {
        PrArr =         (

            {
                dt = "01-Apr-2012 11:20 PM\n";
                dur = "20\n\t\t";
                name = "Shiv Yog - Acharya Ishan Shivanandji\n\t\t";
            },
                        {
                dt = "01-Apr-2012 11:40 PM\n\n\n\t";
                dur = "20\n\t\t";
                name = "Param Pujya Swami HariChaitanya Puriji Maharaj\n\t\t";
            };
            sid = "560\n";
    },

}
i want to fetch data according to sid in a array.

Thanx in advance

  • 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-06-01T04:07:22+00:00Added an answer on June 1, 2026 at 4:07 am

    If you are trying to do find the dictionary where the sid is equal a something, then you will need to use NSPredicate.

    From apple documentation:

    Predicates provide a general means of specifying queries in Cocoa. The
    predicate system is capable of handling a large number of domains, not
    just—for example—Core Data or Spotlight. This document describes
    predicates in general, their use, their syntax, and their limitations.

    With NSPredicate you can find all sid that correspond to your search.

    I will give you an example. Based on the array you posted here, you want to return the entry that have the sid equals to @”530\n”, what you will need to do is:

    NSPredicate* predicate = [NSPredicate predicateWithFormat:@"sid LIKE %@",@"530\n"];
    NSDictionary* entry = [[parentArray filteredArrayUsingPredicate:predicate] objectAtIndex:0];
    

    But if you are trying to sort your array based on the sid, you can use the NSSortDescriptor, that will return your array sorted based in the sid.

    From apple documentation:

    A sort descriptor describes a comparison used to sort a collection of
    objects. You create an instance of NSSortDescriptor that specifies the
    property key to be sorted, and whether the comparison should be in
    ascending, or descending order. A sort descriptor can also specify a
    method to use when comparing the property key values, rather than the
    default of compare:.

    It is important to remember that NSSortDescriptor does not sort
    objects. It provides the description of how to sort objects. The
    actual sorting is done by other classes, often NSArray or
    NSMutableArray.

    One example for you

    NSSortDescriptor *sidDescriptor= [[NSSortDescriptor alloc] initWithKey:@"sid" ascending:YES];
    NSArray* sortDescriptors = [NSArray arrayWithObject:sidDescriptor];    
    NSArray* sortedArray = [parentArray sortedArrayUsingDescriptors:sortDescriptors];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello frnds I have windows mobile application, that retrieves location info. Now i want
Hello I have the following error by git-fsck, which cannot be cleaned by git-gc
Hello we have an SQL server application running over a low bandwith connection. We
I have a string array, and it may contain an element with the text
I have a function which accepts some values as char array[] parameters. These values
Hello all and thanks for the attention! I have a problem that must both
Hello I have a double linked list set up, and i have a search
I have a string Hello hello (including the quotes) and i just want to
Hello guys I am working on silverlight and I have issue regarding on database
Hello I have strange problem. I configured spring + hibernate. I`m using annotation configuration

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.