Ios 为什么可以';我不能正常工作吗?(视频演示)

Ios 为什么可以';我不能正常工作吗?(视频演示),ios,apple-watch,watchconnectivity,Ios,Apple Watch,Watchconnectivity,当手表被快速停用和重新激活(在1-2秒内降低和升高)时,WatchConnectivity似乎无法更新其可达状态。这在我的设备上可靠地发生 编辑:下面是错误的演示: 这是一份公开的雷达报告#23337218 我已经编写了一个测试项目来为您提供最简单的bug示例 import UIKit import WatchConnectivity @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, WCSess

当手表被快速停用和重新激活(在1-2秒内降低和升高)时,WatchConnectivity似乎无法更新其可达状态。这在我的设备上可靠地发生

编辑:下面是错误的演示:

这是一份公开的雷达报告#23337218

我已经编写了一个测试项目来为您提供最简单的bug示例

import UIKit
import WatchConnectivity

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, WCSessionDelegate {

    var window: UIWindow?
    private let session: WCSession? = WCSession.isSupported() ? WCSession.defaultSession() : nil

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        session?.delegate = self;
        session?.activateSession()
        return true
    }
    func sessionReachabilityDidChange(session: WCSession) {
        print("Session \(session.reachable ? "reachable" : "not reachable")")
        dispatch_async(dispatch_get_main_queue(),{
            //updates UI
        })
    }
}
还有手表分机

import WatchKit
import WatchConnectivity

class ExtensionDelegate: NSObject, WKExtensionDelegate, WCSessionDelegate {
    private let session: WCSession? = WCSession.isSupported() ? WCSession.defaultSession() : nil

    func applicationDidFinishLaunching() {
        // Perform any final initialization of your application.
    }

    func applicationDidBecomeActive() {
        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
        session?.delegate = self;
        session?.activateSession()
    }

    func applicationWillResignActive() {
        // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
        // Use this method to pause ongoing tasks, disable timers, etc.
    }

}
当我放下手表时会发生什么:委托在1-2秒内调用sessionReachabilityDidChange,给出正确的状态

然后 如果我在sessionReachabilityDidChange更新后启动监视,代理将按预期再次被调用

但是,如果我在sessionReachabilityDidChange更新之前启动watch,代理只会被调用一次,反映无法访问的状态,并且无法再次调用以反映watch应用程序的正确活动状态

这是该项目的下载


编辑:我应该提到,这在模拟器上似乎不是问题。

2.0.1抱歉,忘记添加了。iPhone上的9.0.2。听起来和看起来都像是操作系统中的一个bug。你有没有向苹果公司提交错误报告?没有。我想这是一个很明显的错误,它一定是以前见过的。我想我错了。雷达文件#23337218。我一定错过了一些关键的东西。这真的搞砸了我的应用程序。D: