Uitableview iOS7中的MDAudioPlayerTableViewCell崩溃
我必须在iOS应用程序中使用Uitableview iOS7中的MDAudioPlayerTableViewCell崩溃,uitableview,custom-controls,ios7,Uitableview,Custom Controls,Ios7,我必须在iOS应用程序中使用MDAudioPlayerTableViewCellcustomtableViewcell 它在iOS5和iOS6中运行良好,但在iOS7中却没有 当我运行它时,会出现以下错误崩溃消息并崩溃 2013-10-03 21:07:36.401 MyApp[656:60b] -[UITableViewCellScrollView drawContentView:]: unrecognized selector sent to instance 0x15f71390 2013
MDAudioPlayerTableViewCell
customtableView
cell
它在iOS5和iOS6中运行良好,但在iOS7中却没有
当我运行它时,会出现以下错误崩溃消息并崩溃
2013-10-03 21:07:36.401 MyApp[656:60b] -[UITableViewCellScrollView drawContentView:]: unrecognized selector sent to instance 0x15f71390
2013-10-03 21:07:36.403 MyApp[656:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableViewCellScrollView drawContentView:]: unrecognized selector sent to instance 0x15f71390'
*** First throw call stack:
(0x2f2e6f53 0x399516af 0x2f2ea8e7 0x2f2e91d3 0x2f238598 0xc4b5f 0x31ad8001 0x31710171 0x316f99f7 0x317d286d 0x316f92ab 0x316f8f53 0x316dcc5d 0x316dc8f5 0x316dc2ff 0x316dc10f 0x316d5e3d 0x2f2b21d5 0x2f2afb79 0x2f2afebb 0x2f21ace7 0x2f21aacb 0x33ee8283 0x31abca41 0xa3c79 0xa3c00)
libc++abi.dylib: terminating with uncaught exception of type NSException
下面是单元格中的代码,用于rowatinexpath
static NSString *CellIdentifier = @"Cell";
MDAudioPlayerTableViewCell *cell = (MDAudioPlayerTableViewCell *)[tbl dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[MDAudioPlayerTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
iOS7如何解决这个问题?假设您有一个扩展UIView的cellview
@interface CellView : UIView
- (void) drawRect:(CGRect)r;
@end
在您的实现中,您有如下内容
@implementation CellView
- (void)drawRect:(CGRect)r {
[(Cell *)superview drawContentView:r];
}
@end
把这个换成
@implementation CellView
- (void)drawRect:(CGRect)r {
UIView *superview = [self superview];
if (![superview isKindOfClass:[UITableViewCell class]]) {
superview = [superview superview];
}
[(Cell *)superview drawContentView:r];
}
@end
干杯
Rui假设您有一个扩展UIView的cellview
@interface CellView : UIView
- (void) drawRect:(CGRect)r;
@end
在您的实现中,您有如下内容
@implementation CellView
- (void)drawRect:(CGRect)r {
[(Cell *)superview drawContentView:r];
}
@end
把这个换成
@implementation CellView
- (void)drawRect:(CGRect)r {
UIView *superview = [self superview];
if (![superview isKindOfClass:[UITableViewCell class]]) {
superview = [superview superview];
}
[(Cell *)superview drawContentView:r];
}
@end
干杯
鲁伊