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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:19:27+00:00 2026-06-04T04:19:27+00:00

Here is the situation: I have created a custom view class with UITextView as

  • 0

Here is the situation:
I have created a custom view class with UITextView as its member. I make textView as a first responder after some event occurs.

@inteface MyCustomView : UIView{
   UITextView* textView;
}

- (void) doSomething;

@end

During program execution I send [doSomething] message to MyCustomView’s instance.

[myCustomViewInstance doSomething];

What happens is very interesting, the program crashes by complaining that UITextView:doSomething is unrecognized selector.

Why is the program calling doSomething on UITextView (its member variable) instead of MyCustomView’s instance.

What could be possibly wrong here ? (of course this is a canonical version of what I am doing but I don’t understand in any logical error scenario this could be true unless something is messed up at compiler level)

What do you think I should investigate further ?

  • 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-04T04:19:28+00:00Added an answer on June 4, 2026 at 4:19 am

    First, Objective-C doesn’t have “member” variables, it has instance variables. Minor thing; but terminology does matter.

    Secondly, the crash is happening because myCustomViewInstance is pointing to an instance of UITextView and not your subclass. This may be because you made such an assignment inadvertently or it may be because you have an over-release issue and it so happens that said variable ends up pointing to the wrong object by coincidence.

    Finally, while there are certainly compiler bugs, it is exceedingly unlikely that such straightforward code would unveil a heretofore unknown compiler bug. The compiler you are using is the very same one that is used to compile the umpteen millions of lines of code of the OS; such a simple bug would very likely means no apps would work or, quite likely, the device wouldn’t even boot.

    That assumes that said line of code is actually what is crashing.

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

Sidebar

Related Questions

Okay, here's the situation: We have a table of about 50 columns (created by
Here's my situation: I have a protocol with a class method that parses an
O.K. Here's the situation... I have a custom mxml component that contains a couple
I have a weird situation where I have created a separate validation class for
Here's the situation: I have a variable number of dynamically created update panels on
I have a situation here. I need to create an employee card structure in
Here is the situation : I have a vertical menu with div. Each div
Here is the situation : we have to offer a customer with a web-based
Here is my situation: I have one table that contains a list of drugs
here's the situation: I have a where in every cell all the area has

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.