NSNotificationCenter 传对象

 [[NSNotificationCenter defaultCenter] postNotificationName:@"postCity" object:pro];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(cityCallBack:) name:@"postCity" object:nil];

- (void)cityCallBack:(NSNotification *)notification
{
    if (nil != notification.object)
    {
        ProvinceModel *obj = (ProvinceModel *)notification.object;
        [addresslbl setText: obj.cityName];
    }
}

 

posted @ 2014-01-15 19:55  菜鸟程序猿  阅读(520)  评论(0编辑  收藏  举报