ios 通知

//创建通知

NSDictionary*dic =@{@"address":address,@"longitude":longit,@"latitude":latit};

NSNotification*notification =[NSNotificationnotificationWithName:@"tongzhiPlaceAndName"object:niluserInfo:dic];

//通过通知中心发送通知

[[NSNotificationCenterdefaultCenter]postNotification:notification];




//接受来自选择地址的通知

[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(PlaceAndName:)name:@"tongzhiPlaceAndName"object:nil];

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • iOS 提供了一种 “同步的” 消息通知机制NSNotificationCenter,观察者只要向消息中心注册, ...
    MasterChen阅读 2,263评论 4 16
  • 现在发通知的viewController中 NSDictionary * dict = [[NSDictionar...
    小暖风阅读 147评论 0 1
  • 如果在一个类中想要执行另一个类中的方法可以使用通知1.创建一个通知对象:使用notificationWithNam...
    wangjianjun0730阅读 768评论 0 0
  • 要了解通知、KVO、代理的区别,合理利用。 [A]通知是什么: 通知(NSNotification)是iOS的一种...
    YH的练手记阅读 182评论 0 0
  • 通过编写一些简单的算法学习golang语言。下面是插入排序算法golang语言的实现:一般的写法: golang语...
    昙花未现阅读 811评论 0 1