1、Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
分析:字典的问题,字典中不可以插入空值(nil)
解决的办法:检查项目中的字典有木有误传入空值。
2、Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:]: A multiplier of 0 or a nil second item together with a location for the first attribute creates an illegal constraint of a location equal to a constant. Location attributes must be specified in pairs'
分析:毫无疑问是布局的时候出问题了
解决:
而我个人是将布局放在 - (void)viewWillAppear:(BOOL)animated
,又因为我使用了self.navigationController.interactivePopGestureRecognizer.delegate
而导致了这个问题,然后我将 布局放到- (void)viewDidLoad
发现问题确实没有出现了。
另外注意别同时用 Masonry和XIB AutoLayout,否则莫名的出现上面这个问题啦