这里是发送通知传值的地方 :  输出打印 memer有值的
DRRRRosterMember* member=[[[DRRRRosterMember alloc]initWithPresence:presence] autorelease];
        [self updateMember:member];
        [[NSNotificationCenter defaultCenter] postNotificationName:DRRRosterUpdateFriendListNotification object:member];
        DLog(@"*********************** member %@ ***********************", member);这里是接受通知  :
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateRosterFriendListNotification:) name:DRRRosterUpdateFriendListNotification object:nil];该方法会执行 不过输出为 ---------****************--------- notification.object (null) ------************************----------
- (void)updateRosterFriendListNotification:(NSNotification *)notification
{    NSLog(@"---------****************--------- notification.object %@ ------************************----------",notification.object);
}不知道怎么回事  望指导

解决方案 »

  1.   

    我还没试过消息直接传送对象,我记得只能传输字典
    你在- (void)updateRosterFriendListNotification:(NSNotification *)notification这个方法里打印notification.UserInfo看看有没有你想要的数据
      

  2.   

    DRRRRosterMember* member=[[[DRRRRosterMember alloc]initWithPresence:presence] autorelease];
    尝试下这里不要autorelease,等通知处理完后,在release对象;
      

  3.   

    那极端些,如果不释放改对象,是否可以拿到值呢?
    依次类推,看看真正的问题是生命周期管理,还是其它引起的;理论上这样传递参数是不规范的,但是确实是可以的;不释放也没有数据 其他通知事件都是这样写的 有数据的        这样传参数不规范吗  是该userInfo字典传值吗
      

  4.   


    传的是 member
      

  5.   

    [[NSNotificationCenter defaultCenter] postNotificationName:@"name object:nil userInfo:@{key:value}]; 这样传值 放在userInfo里
    notification.userInfo[key]取值