Ios UITextField在被触摸时崩溃

Ios UITextField在被触摸时崩溃,ios,objective-c,iphone,uitextview,Ios,Objective C,Iphone,Uitextview,我调试这个有困难。我有一个UITextView,当被触摸时会崩溃。只有其中一些会崩溃,比如:账户类型和增值税季度末。 这是崩溃时屏幕的样子: 代码如下: @synthesize txtAccType = _txtAccountType; - (void)viewDidLoad { [super viewDidLoad]; arrAccountType = [[NSMutableArray alloc] initWithObjects:@"Freelancers", nil];

我调试这个有困难。我有一个UITextView,当被触摸时会崩溃。只有其中一些会崩溃,比如:账户类型和增值税季度末。 这是崩溃时屏幕的样子:

代码如下:

 @synthesize txtAccType = _txtAccountType;

- (void)viewDidLoad {
  [super viewDidLoad];
  arrAccountType = [[NSMutableArray alloc] initWithObjects:@"Freelancers", nil];

  //self.title = @"Account Setting";
  self.title = NSLocalizedString(@"AccountSetting", nil);

  self.navigationItem.rightBarButtonItem = self.doneBarButtonItem;

  arrCatId = [[NSMutableArray alloc] init];
  arrCategory = [[NSMutableArray alloc] init];
  arrTotal = [[NSMutableArray alloc] init];

  tag = 0;
  [svAccountSetting setContentSize:CGSizeMake(280, 600)];
  arrCsvData = [[NSMutableArray alloc] init];

  quarterEndDatesArray = [[NSArray alloc] initWithObjects:
                 @"April/Jul/Oct/Jan",
                 @"May/Aug/Nov/Feb",
                 @"June/Sep/Dec/Mar", nil];

  [self setAcc];
}

-(IBAction)selectAccountType
{
  [self.txtAccType resignFirstResponder];
  [svAccountSetting setContentOffset:CGPointMake(0, 6) animated:YES];
  [ActionSheetPicker displayActionPickerWithView:self.view data:arrAccountType selectedIndex:self.selectedIndex target:self action:@selector(itemWasSelected:) title: NSLocalizedString(@"Select_Account_Type", nil) ];
}

- (void)itemWasSelected:(NSNumber *)selectedIndexs {
  //Selection was made
  self.selectedIndex = [selectedIndexs intValue];
  self.txtAccType.text = [arrAccountType objectAtIndex:self.selectedIndex];
}
由于这个项目比较老,我想知道一些经验丰富的iOS开发人员是否能够提供帮助。

这种方法在触摸屏上的UITextView上崩溃


[ActionSheetPicker显示ActionPickerWithView:self.view数据:ArraAccountType selectedIndex:self.selectedIndex目标:self操作:@selectoritemWasSelected:title:NSLocalizedString@Select_Account_Type,无]

首先尝试将selectedIndex设置为0:

[ActionSheetPicker displayActionPickerWithView:self.view data:arrAccountType selectedIndex:0 target:self action:@selector(itemWasSelected:) title: NSLocalizedString(@"Select_Account_Type", nil) ];

当调试器崩溃时,你在调试器中得到了什么消息?崩溃消息?根本没有消息。这是另一件很难做到的事。你测试的是什么iOS版本?当触摸到所有textView时,尝试辞职FirstResponder。是的,我想是这样。但是为什么?哪种版本的ActionSheetPicker?