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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:33:16+00:00 2026-06-12T11:33:16+00:00

Suppose I am creating a subclass of UITextView named for example, myTextView. I will

  • 0

Suppose I am creating a subclass of UITextView named for example, myTextView. I will make that class its own delegate. So, I need to implement the delegates methods like

- (void)textViewDidBeginEditing:(UITextView *)textView {

Should I declare this method like that or like this?

- (void)textViewDidBeginEditing:(myTextView *)textView {

it appears to me like recursive, because I am inside myTextView class, defining a delegate that is referring itself…

what is the correct approach? 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-12T11:33:18+00:00Added an answer on June 12, 2026 at 11:33 am

    Just for clarification is better to implement the methods like are defined in the protocol:

     - (void)textViewDidBeginEditing:(UITextView *)textView
    

    If you implement the protocol methods with your custom class type or whatever class type, the methods will still get called because there is not type check performed. The parameter will be actually your custom subclass. Anyway, and again for clarification, I suggest to have an inner cast if you want to deal with the ivars of your custom subclass:

    - (void)textViewDidBeginEditing:(UITextView *)textView {
        MyTextView * myTextView = (MyTextView *)textView;
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I am creating a UITableViewCell subclass. The cell will not know what its
Suppose you are creating a class with multiple .cpp files (which each contain the
Suppose that a process is creating a mutex in shared memory and locking it
Suppose I have a static method of my class that returns an object of
Im creating a little database that has employee, emp_shift, shift, tables now im suppose
I am creating an iOS application that is suppose to get the list of
What is the Django way of creating a reusable template? Example: Suppose a lot
Suppose I'm creating a session class, with relevant implementation as below: public class Session()
Suppose chest is a list of coordinates that are two item lists. For example
I am creating my own streambuf subclass and using the C++03 spec (ISO/IEC 14882:2003)

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.