2012-05-12 2 views
1

에서 UITextView을 서브 클래스 화하면 canBeforeFirstResponder에서 disable copy, select, and select allUITextView으로 덮어 쓸 수 있습니다.서브 클래스 UITextView

#import <UIKit/UIKit.h> 

@class English; 

@protocol EnglishDelegate 

- (void)dismissViewDidFinish:(UIViewController *)viewController; 

@end 


@interface English: UIViewController <UITextViewDelegate, UIScrollViewDelegate> 


{ 
id<EnglishDelegate> delegate; 
UITextView *textView; 
UINavigationBar *navBar; 
UINavigationController *navigationController; 

} 

@property (nonatomic, retain) UITextView *textView; 
@property (nonatomic, assign) UINavigationBar *navBar; 
@property (strong, nonatomic) UINavigationController *navigationController; 
@property (nonatomic, assign) id<EnglishDelegate> delegate; 
@property (nonatomic, retain) UIScrollView *scrollView; 

-(void)dismissView:(id)sender; 

@end 

누구나 파일을 h 파일로 서브 클래 싱하는 방법을 알고 있습니다.

도움 주셔서 감사합니다.

+1

가능한 중복 [복사, 잘라 내기, 선택, UITextView에서 모두 선택을 어떻게 해제] (http://stackoverflow.com/questions/ 1426731/how-disable-copy-cut-select-select-all-in-uitextview) –

답변

2

UITextView을 다른 클래스의 하위 클래스로 만들지는 않을 것입니다. 다른 파일에 그냥 일반 서브 클래스를하고는 그래서 canBecomeFirstResponder을 무시할 것 :

- (BOOL)canBecomeFirstResponder { 
    return NO; 
} 
+0

m 파일에서 하위 클래스로 말할 수 있습니다. – user1120133

+0

'.h' 파일로 서브 클래스 화하고 해당'.m' 파일의 메소드를 오버라이드 할 수 있습니다. –

+0

하위 클래스를 지정하지 않으면 canBecomefirstresponder를 오버라이드하거나 복사 붙여 넣기 메뉴를 비활성화하는 다른 방법이 있습니다. – user1120133