我正在使用MKMapView
与annotations
的应用。在iOS7上一切正常,但是当我在iOS6上尝试它时,当我点击一个注释时,应用程序崩溃了:
*** Assertion failure in -[MyAnnotationView layoutSublayersOfLayer:], /SourceCache/UIKit_Sim/UIKit-2380.17/UIView.m:5776
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. MyAnnotationView's implementation of -layoutSubviews needs to call super.'
我添加了:
- (void)layoutSubviews
{
[super layoutSubviews];
}
到我的MyAnnotationView
,但没有任何变化。我真的不知道该怎么做。
感谢您的帮助!
编辑:
我正在使用自动布局。我试图添加
self.translatesAutoresizingMaskIntoConstraints = NO;
在MyAnnotationView
init
方法中,但没有任何变化。 (我也试过了YES
)