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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:41:50+00:00 2026-05-20T00:41:50+00:00

Most overloaded methods require [super theMethod] call. (For example, [super viewDidLoad]; , [super viewWillAppear];

  • 0

Most overloaded methods require [super theMethod] call.

(For example, [super viewDidLoad];, [super viewWillAppear]; and [super dealloc];)

I didn’t think twice whether I need [super touchesBegan:withEvent:] call or not, but it seems to play a role somehow.

When do I need it and when don’t I need it?

I’m trying to programmatically cancel touch events when I need to, and it seems to be related to the question I asked.

  • 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-20T00:41:51+00:00Added an answer on May 20, 2026 at 12:41 am

    While it all depends on the expected behaviors of the object, let’s point out the basic: You call the superclass implementation in an overridden method (you mean overriding, not overloading) if you want default behaviors implemented by the superclass.

    So the questions you should ask are:

    1) What does the superclass implementation do?

    2) Do I need it for my object?

    So what does touchesBegan:withEvent: etc. of your superclass do? It depends on your class hierarchy. The custom classes in your class hierarchy may already override those methods and you may want those behaviors, or not. I assume that no custom class has yet overridden those methods, so you have to check Cocoa implementations only.

    touchesBegan:withEvent: is first defined in UIResponder class. Let’s look at the UIResponder documentation, which says

    The default implementation of this method does nothing. However immediate UIKit subclasses of UIResponder, particularly UIView, forward the message up the responder chain.

    So you get a theory here. If your class directly inherits from UIResponder, you don’t need to call the superclass implementation at all as it does nothing anyway. If it inherits from other UIKit subclasses such as UIView, calling the superclass implementation will enable forwarding messages up the responder chain. However, overriding touchesBegan:withEvent: perhaps means that your subclass wants to handle touch events itself, so you don’t want to forward the events up the responder chain. So, I guess you don’t want to call the superclass implementation here.

    It really depends on the situation. Say, that you subclass a UIScrollView, and implements one of the touches... method. If you still want the view to scroll as the user drags, then you want to call the superclass implementation because it will handle scrolling for you.

    To sum up, you have to be able to answer the two questions above to decide. To find out what a superclass implementation does, read about it in the Apple Documentation. In many cases, if what a superclass implementation does is essential for common expected behaviors, the guide documents give an explicit advice to call the superclass implementation.

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

Sidebar

Related Questions

Most of the implementations I find require a hardware instruction to do this. However
Most of our Eclipse projects have multiple source folders, for example: src/main/java src/test/java When
Are there any best practices on returning different return types on overloaded methods? For
Most of my C/C++ development involves monolithic module files and absolutely no classes whatsoever,
Most of time we represent concepts which can never be less than 0. For
Most program languages have some kind of exception handling; some languages have return codes,
Most mature C++ projects seem to have an own reflection and attribute system ,
Most of the MVC samples I have seen pass an instance of the view
Most of my users have email addresses associated with their profile in /etc/passwd .
Most precompiled Windows binaries are made with the MSYS+gcc toolchain. It uses MSVCRT runtime,

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.