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

  • Home
  • SEARCH
  • 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 4093030
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:34:00+00:00 2026-05-20T19:34:00+00:00

From the start, my UITextView with editable property to true is not editable (via

  • 0

From the start, my UITextView with editable property to true is not editable (via settings in a NIB). The behaviour is such that a user can select and copy text but not edit. This is the way things should be.

However, if I make a call to setSelectedRange, a side effect is that the editable property is set to YES.

Setting it back to NO [textview setEditable:NO] scrolls to the bottom of the textView and undoes my programmatic selection. It also doesn’t work, as editing becomes enabled anyway. The keyboard appears and everything.

I need to be able to select something programmatically and keep the textView in a state where users can only copy and select text.

[textView select:self];
[textView setSelectedRange:selectedText];

I’m stuck. Looking for any advice you can give.

This doesn’t work:

[textView select:self];
[textView setSelectedRange:selectedText];
[textView setEditable:NO];

I’ve also tried setting the delegate function textViewShouldBeginEditing to return NO:

- (BOOL)textViewShouldBeginEditing:(UITextView *)textView {
    return NO;
}

That just locks everything down and I can’t select any text.

  • 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-20T19:34:00+00:00Added an answer on May 20, 2026 at 7:34 pm

    This appears to work for me in a similar situation:

    • just let the textview be editable
    • [textView setDelegate:self];
    • [textView select:self];
    • [textView setSelectedRange:range];
    • add a function (BOOL)textView:shouldChangeTextInRange:replacementText: returning NO
    • and the final trick: assign an empty view as a keyboard for the textview, using:

    textView.inputView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];

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

Sidebar

Related Questions

Possible Duplicate: MVVM: Tutorial from start to finish? i just started learning WPF. i
I need to read a stream two times, from start to end. But the
Currently, I plan to remove all items from vector, which is not found in
Notes as a UITextView in navigation base application .How to save text data after
I'm looking to download a list of issues from our JIRA issue list, to
While I have made a topic like this in the past, this is from
I've been directed to an very nice article that shows how to create a
I have some xibs with all sorts of text controls (UITextFields, UITextViews). Since the
I have this query: SELECT COUNT(*) as clicks, DATE_FORMAT(FROM_UNIXTIME(click_date), '%w %M %Y') as point
I want 4 general RegEx expressions for the following 4 basic cases: Up to

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.