2012-03-27 114 views
2

我的UITextView委托方法没有触发。UITextView委托方法没有触发

UILabel *fieldLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 290, 20)]; 
fieldLabel.text = nodeproperty.name; 
[rowsInSectionLabels addObject:fieldLabel]; 
UITextView *textViewStatus = [[UITextView alloc] initWithFrame:CGRectMake(5, 25, 290, 30)]; 
[textViewStatus setTextAlignment:UITextAlignmentLeft]; 

// For the border and rounded corners 
[[textViewStatus layer] setBorderColor:[[UIColor lightGrayColor] CGColor]]; 
[[textViewStatus layer] setShadowColor:[[UIColor grayColor] CGColor]]; 
[[textViewStatus layer] setBorderWidth:1]; 
[[textViewStatus layer] setCornerRadius:5]; 
[textViewStatus setClipsToBounds: YES]; 
textViewStatus.delegate = self; 
[textViewStatus setEditable:YES]; 

我的接口

@interface WorkflowViewController : UIViewController <UITextFieldDelegate, UITextViewDelegate, UITableViewDataSource, UITableViewDelegate, UIPickerViewDelegate, UIPickerViewDataSource, PickerRowSelected> 

我这里补充一个断点,并没有什么...

- (void)textViewDidBeginEditing:(UITextView *)textView 
{ 
    MultilineTextViewController *multiLineText = [[MultilineTextViewController alloc] init]; 
    [self presentModalViewController:multiLineText animated:YES]; 
} 

任何想法?

我所有的其他委托方法工作完全

+0

键盘是否显示?你有断点吗?你有没有实现' - (BOOL)textViewShouldBeginEditing:(UITextView *)textView'返回YES?这不是坏事,但你可以尝试,如果它被解雇。 – 2012-03-27 09:25:40

+0

键盘显示出来,我可以键入UITextView,即使该委托方法不会被解雇,是断点被启用,我还有其他的断点也在该视图中,我赶上 – Armand 2012-03-27 09:34:49

+0

这个textView是如何添加到视图的WorkflowViewController?看来你是以编程方式进行的。你有没有提及它(财产,iVar)? – 2012-03-27 09:45:52

回答

0

好我正在使用枚举一个愚蠢的错误,并添加UITextView中的观点,我有一个if语句,增加或者一个TextView或文本框和如果添加的TextView没有按预期工作,现在所有作品

相关问题