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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:23:16+00:00 2026-06-13T10:23:16+00:00

So I never GOT how titleForHeaderInSection and, basically, grouped UITableView work. I gave up

  • 0

So I never GOT how titleForHeaderInSection and, basically, grouped UITableView work. I gave up trying to create one and ended up using plain lists for the moment. I’d appreciate if any of the following points could be explained:

Understanding it…

  1. If I want a grouped UITableView I understand I need to return how many groups (sections) I want in it using numberOfSectionsInTableView. Say, return 3.

  2. Then I’ll need to return how many rows I’ll have in each different section, right? I can do it in numberOfRowsInSection. Say, return 2 for the first section, 4 for the second, 6 for the third, right?

  3. If I want each of those sections to have a different title, I’ll need to use titleForHeaderInSection, but I find it tricky to use. However it seems I just need to get the section integer and set the title to my sections’ array using objectAtIndex, right?

  4. In cellForRowAtIndexPath do I need to do anything at all regarding sections or how I’ll show the cells? Seems I don’t, but I’m not sure…

Problem

My data is structured like that (it’s a JSON array containing dictionaries in each array entry):

ArrayItemOne
    DictionaryKeyOne:DictionaryValueOne
    DictionaryKeyTwo:DictionaryValueTwo
ArrayItemTwo
    DictionaryKeyOne:DictionaryValueOne
    DictionaryKeyTwo:DictionaryValueTwo
ArrayItemThree
    DictionaryKeyOne:DictionaryValueOne
    DictionaryKeyTwo:DictionaryValueTwo

My sections titles are actually the DictionaryValueTwo of all 3 ArrayItemFoo above, and it’s dynamic, I don’t know how many of them will be today or tomorrow, it comes from the JSON. Then I create a unique set of them and count it. That’s my numberOfSectionsInTableView.

But how in hell I’ll get my rows grouped by this DictionaryValueTwo in each different section, ONLY if their DictionaryValueTwo matches the section header? Right now I can’t control what rows will be in each section, it’s a mess and I’m confused.

Picture this: all events have a date, my sections are the non-duplicate events dates, but my events need to show up only in the sections matching their dates. That’s it. I’m too stupid to understand how grouped UITableView works to do it…

My code

I have coded a UITableView using plain lists already, it has some commented out stuff for grouped lists, if it helps to understand my question: http://github.com/caio1982/CorreCuritiba/blob/master/iOS/CorreCuritiba/CorreCuritiba/CCMasterViewController.m

Again: some code exemplifying the explanations would be great but it’s not mandatory, I really am looking to understand grouped UITableViews, the concept, the mechanism.

And yes, I’ve searched all over and didn’t find anyone with the same problem I’m facing.

  • 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-13T10:23:18+00:00Added an answer on June 13, 2026 at 10:23 am

    Gustavo Boiko’s patches sort of explains well enough how it’s supposed to work. My data structure was wrong after all: https://github.com/caio1982/CorreCuritiba/pull/3

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

Sidebar

Related Questions

Basically, I have the same question as this one , which unfortunately never got
I posted this earlier on wordpress.stackexchange.com. However, never got a reply. Hence, trying my
I've never used HTTP Handlers before, and I've got one working, but I'm not
I've read many posts about this issue but I never got this to work.
I have been coding in php and using codeigniter as well, never got the
I have never got my head around using regular expressions, so I have a
I've tried using scalac -optimise with version 2.7.7. At that time I never got
I've done some WPF programing and one thing I never got was the command
I'm trying to make shiny buttons in browsers that support gradients, but never got
I've been programming for some time but never got interested in knowing in theory

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.