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

  • Home
  • SEARCH
  • 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 7891801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:42:36+00:00 2026-06-03T06:42:36+00:00

Hi how can I sort my Array in sections by Day , I get

  • 0

Hi how can I sort my Array in sections by Day , I get the data form my webserver (Json) and parse to NSDictionary then save to NSMutableArray… I understand I need to implement

  • (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  • titleForHeaderInSection:
  • Row for Section:

NSMutableArray Log

2012-04-26 06:12:51.256 passingdata[91699:fb03] array : (
{
post =         {
    "CLASS_LEVEL" = "Intro/General";
    "CLASS_TYPE" = "Muay Thai";
    "DAY_OF_WEEK" = Sunday;
    ID = 19;
    "ORDER_BY" = 5;
    TIME = "1:00pm - 2:30pm";
};
}
{
post =         {
    "CLASS_LEVEL" = "General/Intermediate/Advanced";
    "CLASS_TYPE" = "Muay Thai Spar - Competitive";
    "DAY_OF_WEEK" = Friday;
    ID = 27;
    "ORDER_BY" = 5;
    TIME = "6:00pm - 9:00pm";
};
},
{
post =         {
    "CLASS_LEVEL" = "Fighters/Advanced/Intermediate";
    "CLASS_TYPE" = "Fighters Training";
    "DAY_OF_WEEK" = Monday;
    ID = 1;
    "ORDER_BY" = 1;
    TIME = "9:30am - 11:00pm";
};
},

I can Display all the Data on my table , but I want to do it by section for each day (mon ,tue , wed.. sun), I have try NSpredicate and NSSet but still not working .

I don’t know how to group items by day and get all the information to implement all the methods.

Any ideas ?? 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-06-03T06:42:38+00:00Added an answer on June 3, 2026 at 6:42 am

    You should be using the NSPredicate class.

    This is what you should do:

    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"DAY_OF_WEEK MATCHES %@",@"Monday"];
    NSArray *sections = [tableData filteredArrayUsingPredicate:predicate];
    

    The predicate format should not hardcode the day, but should loop through all days and create arrays with results for each day.

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

Sidebar

Related Questions

How can I sort an array first by length, then alphabetically? I have a
How I can sort array data alphanumerically in ruby? Suppose my array is a
How can I sort an array based on two specific values within the array?
How can I sort this array by the value of the "order" key? Even
How can I sort a 2D array in PHP. I want to sort on
I need to sort an array that can look like this: $array[4][0] = array('id'
I'm trying to sort a multidimensional array in objective-c i know that i can
To access the array indice at the xth position we can use some sort
How can I sort this array by city or by id in descending order?
Is there away i can sort the following array into the correct order? Array

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.