【问题标题】:Disable WiFi with CWWiFiClient使用 CWWiFiClient 禁用 WiFi
【发布时间】:2016-01-19 23:11:38
【问题描述】:

CWInterface 似乎在 10.10 Yosemite 中已被弃用,并已被 CWWiFiClient 取代。

CWInterface我通常会使用setPower的方法来禁用WiFi,但我不知道CWWiFiClient有类似的方法。

有谁知道如何使用CWWiFiClient 禁用 WiFi?

谢谢。

【问题讨论】:

    标签: objective-c macos wifi osx-yosemite


    【解决方案1】:

    像这样获取 CWInterface 实例:

    let _en: CWInterface! = CWWiFiClient.sharedWiFiClient().interface()
    

    现在您可以使用setPower 方法再次禁用WiFi!

    【讨论】:

      【解决方案2】:

      根据 Apple CWInterface 和 setPower 在 10.10 中仍然是最新的,但刚刚被修改。

      https://developer.apple.com/library/mac/documentation/General/Reference/APIDiffsMacOSX10_10SeedDiff/frameworks/CoreWLAN.html

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-07-30
        • 1970-01-01
        • 1970-01-01
        • 2012-04-15
        • 1970-01-01
        • 2016-06-14
        相关资源
        最近更新 更多