小编JOf*_*ord的帖子

UIAlertController(ActionSheet)-无法同时满足约束

每当在模拟手机中显示UIAlertController操作表时,都会收到此警告。该代码没什么花哨的。

let action1 = UIAlertAction(title: "Action 1", style: .default) { _ in }
let action2 = UIAlertAction(title: "Action 2", style: .default) { _ in }
let cancel = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
let alert = UIAlertController(title: "title", message: "message", preferredStyle: .actionSheet)

alert.addAction(action1)
alert.addAction(action2)
alert.addAction(cancel)

self.present(alert, animated: true)
Run Code Online (Sandbox Code Playgroud)

我正在运行Xcode 10.2(10E125),Swift5。该约束似乎超出了我的控制范围,但是请告知我是否做错了。

屏幕截图

constraints swift

5
推荐指数
1
解决办法
1086
查看次数

重置区域分配器,分配仍然有效

我的带有MKMapView的ViewController初始化后,在XCode 10.2.1中收到以下消息。

[内存]重置区域分配器,其中24个分配仍然有效

我在ViewController中使用以下代码来清理MKMapView。我执行此操作还是在ViewDidDisappear事件中删除委托似乎并不重要。

deinit {
    self.mapView.delegate = nil
}
Run Code Online (Sandbox Code Playgroud)

这是否表明实际的内存泄漏或我需要修复的其他东西?多次打开/关闭ViewController后,似乎没有泄漏内存。

swift

5
推荐指数
1
解决办法
593
查看次数

标签 统计

swift ×2

constraints ×1