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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:06:48+00:00 2026-05-28T17:06:48+00:00

I was trying to understand why numberOfSectionsInTableView is being called multiple times each time

  • 0

I was trying to understand why numberOfSectionsInTableView is being called multiple times each time I update my data source. From the stack trace in gdb, I see the following

#0  -[JobPickerTVC numberOfSectionsInTableView:] (self=0x4d61fe0, _cmd=0x6207f5, tableView=0x6034800) at JobPickerTVC.m:153
#1  0x003d66ff in -[UITableViewRowData(UITableViewRowDataPrivate) _updateNumSections] ()
#2  0x003d63b0 in -[UITableViewRowData invalidateAllSections] ()
#3  0x00299010 in -[UITableView(_UITableViewPrivate) _endCellAnimationsWithContext:] ()
#4  0x002891e8 in -[UITableView endUpdates] ()
#5  0x000050c8 in -[JobPickerTVC controllerDidChangeContent:] (self=0x4d61fe0, _cmd=0x17109d, controller=0x4da5e40) at JobPickerTVC.m:442

followed by

#0  -[JobPickerTVC numberOfSectionsInTableView:] (self=0x4d61fe0, _cmd=0x6207f5, tableView=0x6034800) at JobPickerTVC.m:153
#1  0x003d66ff in -[UITableViewRowData(UITableViewRowDataPrivate) _updateNumSections] ()
#2  0x003d6417 in -[UITableViewRowData ensureAllSectionsAreValid] ()
#3  0x0029902e in -[UITableView(_UITableViewPrivate) _endCellAnimationsWithContext:] ()
#4  0x002891e8 in -[UITableView endUpdates] ()
#5  0x000050c8 in -[JobPickerTVC controllerDidChangeContent:] (self=0x4d61fe0, _cmd=0x17109d, controller=0x4da5e40) at JobPickerTVC.m:442

From what I can tell, the code executes [UITableViewRowData invalidateAllSections] (line #2 of the first trace) and then [UITableViewRowData ensureAllSectionsAreValid] (line #2 of the second trace). Both of these end by calling [JobPickerTVC numberOfSectionsInTableView:]. So [JobPickerTVC numberOfSectionsInTableView:] is getting called twice. I would like to know why this is happening and what these operations are doing.

There’s one more call to numberOfSectionsInTableView for another reason, but I would like to understand these first.

  • 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-28T17:06:48+00:00Added an answer on May 28, 2026 at 5:06 pm

    Your table numberOfSectionsInTableView is getting called multiple times because you are reloading your table data.whenever you reload table,this method will check for all delegates of tableview.

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

Sidebar

Related Questions

In trying to understand the correlation between program objects and data in tables (here:
Trying to understand this open source app on github, it has a gem file:
I am trying to understand how JPA works. From what I know, if you
While trying to understand the MVVM pattern I came across this video linked from
Trying to understand why rownames = FALSE is not passed on from Test to
Just trying to understand my table isn't being populated when my view controller appears
Am trying to understand jquery. Am a bit slow, maybe cause I come from
Trying to understand radix sort for my data structures class. My teacher showed us
Trying to understand an fft (Fast Fourier Transform) routine I'm using (stealing)(recycling) Input is
Trying to understand the options for will_paginate's paginate method: :page — REQUIRED, but defaults

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.