当我将ProfileHeaderView
作为子视图添加到MDCFlexibleHeaderViewController
时,出现以下错误:
Thread 1: EXC_BAD_ACCESS (code=2, address=0x991fd4)
调用以下方法时引发错误:
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.commonInit()
}
调用super.init()
方法时将调用错误。我在控制台中看不到其他错误消息。关于如何解决它的任何想法?
仅供参考,ProfileHeaderView
类的代码如下:
class ProfileHeaderView: UIView {
@IBOutlet var header: ProfileHeaderView!
override init(frame: CGRect) {
super.init(frame:frame)
commonInit()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.commonInit()
}
private func commonInit(){
Bundle.main.loadNibNamed("ProfileHeaderView", owner: self, options: nil)
addSubview(header)
header.frame = self.bounds
header.autoresizingMask = [.flexibleHeight,.flexibleWidth]
}
/*
// Only override draw() if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
override func draw(_ rect: CGRect) {
// Drawing code
}
*/
}
我不继承MDCFlexibleHeaderViewController
的子类。
错误日志
2018-10-02 22:19:14.179637-0500 builditbigger[564:444592] 5.4.1 - [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO.
Follow the instructions at:
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.
2018-10-02 22:19:14.179752-0500 builditbigger[564:444592] 5.4.1 - [Firebase/Analytics][I-ACS023007] Firebase Analytics v.50001000 started
2018-10-02 22:19:14.184430-0500 builditbigger[564:444592] 5.4.1 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see url)