项目中遇到的error and warning记录

@property(nonatomic,strong)  idplayingTimeObserver;

 self.playingTimeObserver = nil;  //Null passed to a callee that requires a non-null argument

Null passed to a callee that requires a non-null argument

将空值传给一个要求不能为空的属性

@property(nonatomic, strong) __nullable id playingTimeObserver;

解决办法:使用__nullable(可为空的)修饰

 AVPlayerItem was deallocated while key value observers were still registered with it. 

[Warning] Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tableview cell's content view. We're considering the collapse unintentional and using standard height instead.

使用xib创建的cell,设置高度的代理,使用:

            self.discussTBView.estimatedRowHeight = 85;

            self.discussTBView.rowHeight = UITableViewAutomaticDimension;

            returnself.discussTBView.rowHeight;

出现以上警告,并且cell的高度打印出来为-1

出现原因和解决方法:由于在设置cell子控件的约束时候,最靠bottom的子控件没有设置约束导致这个警告,设置警告一定要把父控件撑起来,前后左右都需要有。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Swift1> Swift和OC的区别1.1> Swift没有地址/指针的概念1.2> 泛型1.3> 类型严谨 对...
    cosWriter阅读 11,142评论 1 32
  • Which Clang Warning Is Generating This Message? (http://f...
    喜欢就可以阅读 3,012评论 1 1
  • 消除警告: #pragma clang diagnostic push #pragma clang diagnos...
    维若阅读 2,712评论 0 0
  • 技术无极限,从菜鸟开始,从源码开始。 由于公司目前项目还是用OC写的项目,没有升级swift 所以暂时SDWebI...
    充满活力的早晨阅读 12,694评论 0 2
  • #pragmaclang diagnostic push#pragmaclang diagnostic ignor...
    lusen_b阅读 5,026评论 0 1