UITextView委托方法没有触发

时间:2012-03-27 09:17:56

标签: iphone ios delegates 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];
}

有什么想法吗?

我所有其他委托方法都能很好地运作

1 个答案:

答案 0 :(得分:0)

好的,我在枚举中犯了一个愚蠢的错误并将UITextView添加到View中,我有一个if语句添加了textview或textfield,如果添加textview没有按预期工作,现在全部工作

相关问题