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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:00:46+00:00 2026-06-01T00:00:46+00:00

I have a project in which I need to display multiple UITableView instances inside

  • 0

I have a project in which I need to display multiple UITableView instances inside the same view on the iPad. They also happen to be rotated, but I’m fairly certain this is irrelevant. The user should be unaware that the view is made up of multiple table views. Therefore, I’d like to make it so that when I scroll one tableview, the others scroll with it at the same time.

Because UITableView is a subclass of UIScrollView, I figured I could handle UIScrollViewDelegate methods and pass them along to all of the tableviews. Unfortunately, while I can capture some events, the method call granularity is not fine enough and I’m having trouble passing along these messages to the other tableviews. The closest I can get is implementing -scrollViewDidScroll: and then calling -setContentOffset:animated on every tableview. If I attempt to send this message for all potential cases, I end up locking up because -scrollViewDidScroll is getting called for my -setContentOffset:animated calls, so I end up freezing up. Regardless, if I eliminate the lockup by only using this method to detect scrolling on one tableview and then passing it on to the other tableviews, I find that while the other tableviews do end up scrolling to the same location, They lag behind a second or two.

Here’s a sample project I created.

How can I implement this behavior without subclassing UITableView?

  • 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-01T00:00:48+00:00Added an answer on June 1, 2026 at 12:00 am

    You can get around the callback granularity issue by observing contentOffset directly. In viewDidLoad, set up KVO on each of the table views you need to synchronize:

    for(UITableView *view in self.tableViewCollection)
    {
        [view addObserver:self 
               forKeyPath:@"contentOffset" 
                  options:NSKeyValueObservingOptionNew 
                  context:NULL];
    }
    

    Then, when you observe changes, temporarily unhook the observation, update the other table views’ offsets, and turn observation back on.

    - (void)observeValueForKeyPath:(NSString *)keyPath 
                          ofObject:(id)object 
                            change:(NSDictionary *)change 
                           context:(void *)context
    {
        static BOOL isObservingContentOffsetChange = NO;
        if([object isKindOfClass:[UITableView class]] 
           && [keyPath isEqualToString:@"contentOffset"])
        {
            if(isObservingContentOffsetChange) return;
    
            isObservingContentOffsetChange = YES;
            for(UITableView *view in self.tableViewCollection)
            {
                if(view != object)
                {
                    CGPoint offset = 
                     [[change valueForKey:NSKeyValueChangeNewKey] CGPointValue];
                    view.contentOffset = offset;
                }
            }
            isObservingContentOffsetChange = NO;
            return;
        }
    
        [super observeValueForKeyPath:keyPath 
                             ofObject:object 
                               change:change 
                              context:context];
    }
    

    This can probably be made prettier, but it gets the idea across.

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

Sidebar

Related Questions

recently I've been given a project which need to display a spherical panorama view.
I have a project in which I need a way to display essentially a
I am fairly new to MySQL and have a project in which I need
I have a GWT project in which I need to manually specify currency, number
I have a project in which I would need to copy files found within
I have recently taken on a project in which I need to integrate with
I Have project in which a module needs to display the list of data
I have a practice project which I need help with. It's a simple MailServer
I have been working on a project in GWT for which i need to
I have a project which is source controlled using Subversion and VisualSVN. Since the

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.