Iphone 在MKMapView的子类中设置属性时发生异常
我犯了一个奇怪的错误。在以发布模式安装测试应用程序后,出现了一个错误:Iphone 在MKMapView的子类中设置属性时发生异常,iphone,ios,properties,mkmapview,subclass,Iphone,Ios,Properties,Mkmapview,Subclass,我犯了一个奇怪的错误。在以发布模式安装测试应用程序后,出现了一个错误: [SomeMapView setRotateEnabled:]: unrecognized selector sent to instance 0x1c58ac40 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SomeMapView setRotateEnabled:]: unrecognized
[SomeMapView setRotateEnabled:]: unrecognized selector sent to instance 0x1c58ac40
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SomeMapView setRotateEnabled:]: unrecognized selector sent to instance 0x1c58ac40'
Mapview已初始化,在init方法中,我试图停用旋转。在调试模式下,它运行良好
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
[self setRotateEnabled:FALSE];
[self initDelegate];
}
return self;
}
也许有人知道发生了什么?提前感谢。这是iOS版本中的一个问题。像Suresh指出的那样,RotateeEnabled in仅在iOS7中可用。我必须检查财产是否在那里(或者检查它是否有iOS7)
您的设备正在运行哪个操作系统?rotateEnabled仅在iOS7中可用。是的,这就是问题所在。我更改了测试设备,IOS6中出现了问题。谢谢。
if ([self respondsToSelector:NSSelectorFromString(elementName)])
{
[self setValue:elementInnerText forKey:elementName];
}