dengchaojie

iCloud实现APP多设备数据同步

2017-12-06 16:56  dengchaojie_learner  阅读(1463)  评论(0编辑  收藏  举报

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(objChange:) name:NSUbiquitousKeyValueStoreDidChangeExternallyNotification object:nil];

 

NSConcreteNotification 0x1c024ab60

{

name = NSUbiquitousKeyValueStoreDidChangeExternallyNotification;

object = <NSUbiquitousKeyValueStore: 0x1c4281cc0>;

userInfo = {

    NSUbiquitousKeyValueStoreChangeReasonKey = 0;

    NSUbiquitousKeyValueStoreChangedKeysKey =     (

        store

    );

}}

其中object就是NSUbiquitousKeyValueStore,可以从这里取值;

- (void)objChange:(NSNotification *)note

{

    NSString *store = [note.object objectForKey:@"store"];

    NSLog(@"store == %@",store);

    self.lb.text = store;

    

}

http://www.hudongdong.com/ios/385.html

分类:

技术点:

相关文章:

  • 2021-10-06
  • 2021-09-17
  • 2022-12-23
  • 2022-12-23
  • 2021-08-12
  • 2021-12-16
  • 2021-09-23
猜你喜欢
  • 2021-05-15
  • 2021-08-02
  • 2021-12-15
  • 2021-10-19
  • 2021-12-09
  • 2021-09-21
相关资源
相似解决方案