【问题标题】:Apple tvOS network not available notificationApple tvOS 网络不可用通知
【发布时间】:2016-05-10 06:38:42
【问题描述】:

我正在使用 Reachability 类来检查我的 tvOS 应用程序中的网络是否可用。

当我尝试通知 kReachabilityChangedNotification 时,它没有调用该方法。

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNetworkChange:) name:kReachabilityChangedNotification object:nil];

方法handleNetworkChange 没有被调用。

【问题讨论】:

    标签: objective-c tvos reachability


    【解决方案1】:

    你真的发布了那个通知吗?

    [[NSNotificationCenter defaultCenter] postNotificationName:kReachabilityChangedNotification object:nil];
    

    【讨论】:

    • 是的.. 在 iOS 中它工作正常。但在 TvOS 应用程序中它不起作用。
    • 它将由 Reachability 类知道来处理
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-11-18
    • 2016-05-17
    • 2020-01-12
    • 1970-01-01
    • 2018-01-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多