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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:25:58+00:00 2026-06-12T16:25:58+00:00

The title says multiple button presses, but actually I’m looking to stack multiple events.

  • 0

The title says multiple button presses, but actually I’m looking to stack multiple events. I have a chat application that can receive many chat messages at once. In my messageReceived function, I would like to scroll to the bottom of the most recent chats. The problem I’m having is that sometimes many messages (50+) can come in at the same time. I’ve determined that scrolling to the bottom is a huge performance bottle neck if performed 50 times, but works great if only performed after messages are received.

I’d like scroll to the bottom after a delay, say 0.1 seconds, in my messageReceived function. But I’d like all new chat messages that occur within this 0.1 seconds to “stack”, and only issue a single scroll to bottom request.

I think that a system of setting and canceling timers would work for this, however I can’t get it right. Is there a better way to make this happen! thanks!

  • 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-12T16:26:00+00:00Added an answer on June 12, 2026 at 4:26 pm

    If you are setting your delayed “scroll to the bottom” request with something like

    [[self myObject] performSelector:@selector(scrollToBottom:) 
                          withObject:nil 
                          afterDelay:0.1];  
    

    then you can use a cancel command like

    [NSObject cancelPreviousPerformRequestsWithTarget:[self myObject]
                                            selector:@selector(scrollToBottom:)
                                          object:nil];  
    

    then the only time your scrollToBottom: gets called is when it doesn’t get cancelled (so, the last time in the bunch). Now you don’t need a timer.

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

Sidebar

Related Questions

as the title says: Anyone know about any good/simple multiple file upload script that
Basically, what the title says. I have several properties that combine together to really
The title pretty much says it all. I have a project that for political
The title says most of what I'm looking for: I have 2 buttons on
The title pretty much says it all, but just to clarify: I have an
Title says most of it. I have a div container that holds all the
Basically, what the title says. I have several properties that combine together to really
As it says in the title, I'm looking for multiple excerpt lengths in WordPress.
i need your help as the title says i have a problem inserting multiple
Basically what the title says... I need to have an image that when clicked,

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.