0

I am trying to observe the property isDeviceConnected from the microsoft band api, but it seems to not be working, so I assume that it for some odd reason is not kvo-compliant. But how would I approach observing and responding to changes of a variable? In some cases of normal matters overwriting/editing the setter would be sufficient, but as this is a property of microsoft api Im not able to do these changes?

Any help appreciated

EDIT: basically I want to have an icon that shows if band is connected or not

DevilInDisguise
  • 360
  • 1
  • 4
  • 14

1 Answers1

0

You can detect connection status with the MSBClientManagerDelegate method:

- (void)clientManager:(MSBClientManager *)clientManager clientDidConnect:(MSBClient *)client;
- (void)clientManager:(MSBClientManager *)clientManager clientDidDisconnect:(MSBClient *)client;

You can then use those to control your icon state.

Mark Thistle
  • 1,871
  • 14
  • 21
  • I am already using those delegate methods, but I have it in a separate "MSB" class, which is also included by other classes. So it seems awkward to make instances of the view controllers, that uses this class, in this class itself. Thats why I would rather use isDeviceConnected from within the view controller thats currently active. Do you follow what I mean? (btw, do you have experience with the MSband used on IOS? I have a problem regarding tile creation that I just can't seem to get working) Thx for your input so far – DevilInDisguise May 04 '15 at 11:07
  • You are correct that the SDK is not KVO at the moment. I will raise that as a feature request for a future version. – Mark Thistle May 04 '15 at 21:22