Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Set `maskView` (<UIView: 0x139dbf480; frame = (0 0; 394 288); alpha = 0; hidden = YES; backgroundColor = UIExtendedGrayColorSpace 1 1; layer = <CALayer: 0x30001ca20>>) to `nil` before adding it as a subview of <ZJClockInCalendarContentView: 0x139c8e580; frame = (0 0; 394 288); backgroundColor = UIExtendedGrayColorSpace 1 1; layer = <CALayer: 0x3007326a0>>'
*** First throw call stack:
嗯,坑爹的IOS18,当你基于UIView实现的自己的子类中定义一个属性并初始化时就会出现崩溃!
/// 遮罩
@property (nonatomic, strong) UIView *maskView;
因为UIVIEW本身就有这个属性,你又定义一个!!触发UIVIEW内部的断言出现崩溃!
如何解决:
把你的属性名改为notaView或者其他的命名即可!!