Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Afbar1114

macrumors 6502a
Original poster
Jun 18, 2012
778
6
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?
 
Last edited by a moderator:
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?

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.)
 
UITextView also has a popup saying "Copy Paste Select" even if editing is disabled. Subclass and override with this method to remove:


Code:
// file MyTextView.h
@interface MyTextView : UITextView
- (BOOL)canBecomeFirstResponder;
@end


// 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;
}
@end
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.