【发布时间】:2013-12-10 10:37:41
【问题描述】:
我的代码在 iOS6 上运行良好,但在 iOS7 中崩溃。
我将文本字段与表格视图单元格文本字段进行比较。
- (BOOL)textFieldShouldEndEditing:(UITextField *)textField
{
DLog(@"-> %@", textField.text);
PhotoViewCustomCell *cell = (PhotoViewCustomCell*)[[textField superview] superview];
NSIndexPath *indexPath = [tblPhotoDetail indexPathForCell:cell];
//PhotoViewCustomCell *cell = (PhotoViewCustomCell *)[tblPhotoDetail cellForRowAtIndexPath:indexPath];
PhotoInformation *objPhotoInfo = [selectedPhotos objectAtIndex:indexPath.row];
if ([textField isEqual:cell.mytextfield])
{ =========>crashing in this line
do something
}
else
{
do something
}
}
错误:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableViewCellScrollView mytextfield]: unrecognized selector sent to instance 0xdc119a0'
【问题讨论】:
标签: iphone ipad uitableview ios7 uitextfield