- (void)viewDidLoad {[super viewDidLoad];// 监听 家庭 是否发生切换[[NSNotificationCenter defaultCenter] addObserver:selfselector:@selector(homeIdDidChangedTest) name:@"kThingTPNotificationHomeIdDidChanged" object:nil];}- (void)homeIdDidChangedTest {NSLog(@"\n== 家庭发生了切换");id<ThingFamilyProtocol> familyImpl = [[ThingSmartBizCore sharedInstance] serviceOfProtocol:@protocol(ThingFamilyProtocol)];ThingSmartHome *home = [ThingSmartHome homeWithHomeId:[familyImpl currentFamilyId]];NSLog(@"\n== 当前家庭为: %@" , home.homeModel.name );}
该内容对您有帮助吗?
是意见反馈点击获取服务和帮助
智能客服
400-881-8611
提交工单