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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:44:27+00:00 2026-06-09T07:44:27+00:00

I wish to display table section with date as the section title and name

  • 0

I wish to display table section with date as the section title and name of book in the row. I’m all lost at how to use a NSDictionary to load data into section and rows. Therefore my codes are all screwed up 🙁 Can anyone offer some help, with some sample codes as a guide? My NSMutableArray is as followed:

(
        {
        BIBNo = 187882;
        date = "14/08/2012";
        itemSequence = 000010;
        name = "Increasing confidence / Philippa Davies.";
        noOfRenewal = 0;
        number = 000187907;
        status = "Normal Loan";
        time = "24:00";
        type = Loans;
    },
        {
        BIBNo = 291054;
        date = "14/08/2012";
        itemSequence = 000010;
        name = "iPhone application development for IOS 4 / Duncan Campbell.";
        noOfRenewal = 2;
        number = 000291054;
        status = "Normal Loan";
        time = "24:00";
        type = Loans;
    },
        {
        BIBNo = 244441;
        date = "15/08/2012";
        itemSequence = 000010;
        name = "Coach : lessons on the game of life / Michael Lewis.";
        noOfRenewal = 1;
        number = 000244441;
        status = "Normal Loan";
        time = "24:00";
        type = Loans;
    },
        {
        BIBNo = 290408;
        date = "15/08/2012";
        itemSequence = 000010;
        name = "Sams teach yourself iPhone application development in 24 hours / John Ray.";
        noOfRenewal = 3;
        number = 000290408;
        status = "Normal Loan";
        time = "24:00";
        type = Loans;
    },
        {
        BIBNo = 161816;
        date = "16/08/2012";
        itemSequence = 000010;
        name = "Malaysian Q & As / compiled by Survey & Interview Department ; illustrations by Exodus.";
        noOfRenewal = 1;
        number = 000161817;
        status = "Normal Loan";
        time = "24:00";
        type = Loans;
    },
        {
        BIBNo = 187883;
        date = "16/08/2012";
        itemSequence = 000010;
        name = "Positive thinking / Susan Quilliam.";
        noOfRenewal = 3;
        number = 000187899;
        status = "Normal Loan";
        time = "24:00";
        type = Loans;
    }
)

How do i actually re-add the objects into NSDictionary so that objects with the same date would be stored together to be displayed as rows in the section? Please offer me some advice thanks! T_T

  • 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-09T07:44:29+00:00Added an answer on June 9, 2026 at 7:44 am

    To process your data you would need to do something like

    NSMutableDictionary *dataSource = [[NSMutableDictionary alloc] init]; // This would need to be an ivar
    
    for (NSDictionary *rawItem in rawItems) {
        NSString *date = [rawItem objectForKey:@"date"]; // Store in the dictionary using the data as the key
    
        NSMutableArray *section = [dataSource objectForKey:date]; // Grab the section that corresponds to the date
    
        if (!section) { // If there is no section then create one and add it to the dataSource
            section = [[NSMutableArray alloc] init];
            [dataSource setObject:section forKey:date];
        }
    
        [section addObject:rawItem]; // add your object
    }
    
    self.dataSource = dataSource;
    

    Then to get the section title

    NSArray *sections =[[self.dataSource allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
    return [sections objectAtIndexPath:indexPath.section];
    

    Then to get a row in a section

    NSString *sectionTitle = // get the section title calling the above code
    NSArray *items = [self.dataSource objectForKey:sectionTitle];
    
    return [items objectAtIndex:indexPath.row];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with various rows that display data, in each row I
Currently I have a date in my clients data table and it is stored
I have a <table> and I wish to display an <img> over the <table>
I am using a jquery modal dialog to display a table of data from
I wish to display content depending on the given role(s) of the active user
I have two panels that i wish to display to the user. I decided
I have a website with live stats that I wish to display to every
Under certain circumstances, I wish to display an error message to the user if
I wish fetch data in a XML file, where Tag is a variable.. My
I wish to edit ini files over web server, decided to use django, been

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.