Help!!! is there a way to have the text not be editable?

Discussion in 'iOS Programming' started by Afbar1114, Sep 10, 2012.

  1. Afbar1114, Sep 10, 2012
    Last edited by a moderator: Sep 10, 2012

    Afbar1114 macrumors 6502a

    Jun 18, 2012
    I dont know if this is the right place but i am trying to build an app. is there a way to have the text not be editable? and is there away to keep the app up to date with events and articles?
  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    Or disable (.enabled = NO) a UITextField or UITextView.
  3. Duncan C macrumors 6502a

    Duncan C

    Jan 21, 2008
    Northern Virginia
    For UITextView objects, set the editable property to FALSE.

    For UITextField objects, you can use the enabled property it inherits from UIControl. (As mentioned by another poster.)
  4. solderguy1 macrumors member

    Apr 20, 2012
    UITextView also has a popup saying "Copy Paste Select" even if editing is disabled. Subclass and override with this method to remove:

    // file MyTextView.h
    @interface MyTextView : UITextView
    - (BOOL)canBecomeFirstResponder;
    // File MyTextView.m
    #import "MyTextView.h"
    @implementation MyTextView
    - (id)initWithFrame:(CGRect)frame
        self = [super initWithFrame:frame];
        if (self) {
            // Initialization code
        return self;
    - (BOOL)canBecomeFirstResponder {
        return NO;

Share This Page