0

I am developing an iOS and watchkit with HomeKit integration. I have added some home and room into iOS app. Now i want to retrieve added home and Room.

Below is the code to get home in watchkit. I can get home in iOS by this code.

var homeWatchSore : HomeWatchStore!

var homeStore: HomeWatchStore {
    return HomeWatchStore.sharedStore
}   

var home: HMHome! {
    return homeStore.home
}

var homeManager: HMHomeManager {
    return homeStore.homeManager
}

func registerAsDelegate() {
    homeManager.delegate = self
}
// Below function is used to get Home. But it always shows 0.

func getAllHome () {
    let numberOfRows = homeManager.homes.count
 }

Any idea how to get added Room and Home from iOS to watchKit app.

Rajesh Maurya
  • 3,026
  • 4
  • 19
  • 37
  • Are you testing this on an actual watch? [It won't work in the simulator](http://stackoverflow.com/q/32129849/4151918). –  Feb 12 '16 at 15:22
  • I am testing in simulator. – Rajesh Maurya Feb 13 '16 at 18:28
  • You cannot test your HomeKit watch app on the watchOS simulator. It must be tested on an Apple watch. Try it on a real device, and let us know if that resolves the issue. –  Feb 13 '16 at 19:33

0 Answers0