ios - 当视图控制器中包含自定义视图时应用程序冻结
问题描述
当我将ProfileHeaderView
作为子视图添加到 a时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)
解决方案
推荐阅读
- c++ - 将值从一个堆栈传输到另一个堆栈,在 C++ 中保持相同的顺序
- passwords - 从 executionHistory.bin 中知道加密的密钥库密码
- algorithm - 如何找到窗口的最大对的计数
- javascript - 圆形菜单透明
- flutter - ListView.builder 项目仍然出现在滚动之外
- vue.js - 将 Nuxt 添加到我的 vue 项目后出错(vue-style-loader css 错误)
- swift - 在 iOS 应用程序中使用 MS Edge 浏览器进行 SSO 身份验证
- flutter - 颤振测试仅适用于泵送持续时间
- julia - 如何在 Flux.jl 中使用 LSTM?
- angular - Angular - 错误 TS2322:类型 '{ id: number; 名称:字符串;}' 不可分配给类型 'NgIterable
| 空 | 不明确的'