小编Meg*_*tha的帖子

仅在 iOS 17 设备以下遇到错误“线程 1:EXC_BAD_ACCESS(代码 = 1,地址 = 0x0)”

我刚刚将 XCode 更新到版本 15,遇到此错误(仅限 17 以下的 iOS 版本)\xc2\xa0

\n
Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)\n
Run Code Online (Sandbox Code Playgroud)\n

显示此错误的代码(PathMonitorConectivityProvider.swift):

\n

当我从 XCode 运行代码时(iOS 设备版本是 iOS 16.4),以下代码中出现异常。

\n
import Foundation\nimport Network\n\n@available(iOS 12, *)\npublic class PathMonitorConnectivityProvider: NSObject, ConnectivityProvider {\n\n  private let queue = DispatchQueue.global(qos: .background)\n\n  private var _pathMonitor: NWPathMonitor?\n\n  public var currentConnectivityType: ConnectivityType {\n    let path = ensurePathMonitor().currentPath\n    // .satisfied means that the network is available\n    if path.status == .satisfied {\n      if path.usesInterfaceType(.wifi) {\n        return .wifi\n      } else if path.usesInterfaceType(.cellular) {\n        return .cellular\n      } else …
Run Code Online (Sandbox Code Playgroud)

xcode exception ios swift flutter

11
推荐指数
2
解决办法
5160
查看次数

标签 统计

exception ×1

flutter ×1

ios ×1

swift ×1

xcode ×1