使用UIAlertController 报错 警告 遇到的问题

来源:互联网 发布:手机钉钉 请检查网络 编辑:程序博客网 时间:2024/06/05 21:06

1.使用手机或者模拟器,当型号是6p的时候,会出现以下警告

2016-03-07 14:21:39.076 testInfo[4879:1875194] the behavior of the UICollectionViewFlowLayout is not defined because:

2016-03-07 14:21:39.076 testInfo[4879:1875194] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.

2016-03-07 14:21:39.078 testInfo[4879:1875194] The relevant UICollectionViewFlowLayout instance is <_UIAlertControllerCollectionViewFlowLayout: 0x15ffd4630>, and it is attached to <UICollectionView: 0x160177400; frame = (0 120.667; 270 44); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x15ffd51c0>; layer = <CALayer: 0x15ffd4d00>; contentOffset: {0, 0}; contentSize: {0, 0}> collection view layout: <_UIAlertControllerCollectionViewFlowLayout: 0x15ffd4630>.

2016-03-07 14:21:39.079 testInfo[4879:1875194] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.

2.  Presenting view controllers on detached view controllers is discouraged 

这个警告 

  当使用[selfpresentViewController:alertC animated:YEScompletion:nil];的时候会出现

可以更改为

[self.view.window.rootViewControllerpresentViewController:alertC animated:YEScompletion:nil];

0 0
原创粉丝点击