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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:18:44+00:00 2026-05-13T21:18:44+00:00

The answer to this is probably right under my nose, but I am not

  • 0

The answer to this is probably right under my nose, but I am not seeing it. Maybe someone here could help.

I have a scrollView that allows for vertical scrolling. I set it up:

[clefScrollView addSubview:clefView];
[clefScrollView setContentSize:CGSizeMake(clefView.frame.size.width, clefView.frame.size.height)];
clefScrollView.showsVerticalScrollIndicator = YES;
clefScrollView.showsHorizontalScrollIndicator = NO;
clefScrollView.delegate = self;

I have the following methods included in the same file, in order to support the UIScrollViewDelegate protocol:

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{
    NSLog(@"%f %f", scrollView.contentOffset.y, scrollView.contentSize.height);
}

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
    NSLog(@"scrollViewDidEndDecelerating");
}

- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
{
    NSLog(@"scrollViewDidEndScrollingAnimation");
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    NSLog(@"scrollViewDidScroll");
}

In addition, the .h file for my class includes the protocol:

@interface ClefNotesViewController : UIViewController <UIActionSheetDelegate,UIScrollViewDelegate,DoneWithVCDelegate> {

The problem is that no matter what, the following two are never called:

    -scrollViewDidEndDecelerating
    -scrollViewDidScroll

The other two methods do get called in response to different events. Given that two of the protocol methods are getting called, I assume that I have correctly set the delegate to my self. So, what is the problem?

Thanks!

Update: I found the problem, although haven’t still figured out how to resolve it. My class spans two files. In the second file, a different scrollView is implementing
-scrollViewDidEndDecelerating
-scrollViewDidScroll

THe question is, how can I define two different sets of methods for two different UIScrollViews, in the same class?

I could try to handle two scrollViews with the same delegate methods, but that’s ugly since I won’t be able to keep each set of delegates with the scrollView’s file. I could also split my class. Is there another way?

  • 1 1 Answer
  • 1 View
  • 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-13T21:18:44+00:00Added an answer on May 13, 2026 at 9:18 pm

    THe question is, how can I define two
    different sets of methods for two
    different UIScrollViews, in the same
    class?

    The delegate methods accept a scrollview objects as their parameter. You need to check which scrollview is being passed and respond accordingly. You can set each scrollview’s tag property in order to identify them.

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

Sidebar

Related Questions

This is probably a simple one to answer, but I'm stuck, so here goes.
There is probably already an answer for this somewhere, but I must not be
So this is probably a fairly easy question to answer but here goes anyway.
This is probably a borderline question because I'm not sure there's a right answer,
This is probably a often asked question but I couldn't find a right answer
I have a feeling that this probably is not possible using strictly CSS, but,
This has probably been answer already but I am trying to return the primary
This is probably got a simple answer to it, but I am having problems
This is probably a really dumb question with a simple answer but... I am
this is probably a stupid question but I can't seem to find the answer.

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.