objective c - NSNotification arrived with broken object -
i'm posting notification in manner:
... ivsession *newsession = [[[ivsession alloc] initwithdictionary:propertydict] autorelease]; nsdictionary *notifparams = [nsdictionary dictionarywithobject:newsession forkey:@"session"]; nsnotification *newsessionnotif = [nsnotification notificationwithname:ivnewsessionnotificaiton object:self userinfo:notifparams]; ...
ivsession interface:
@interface ivsession : ivmappableobject { nsstring *_ssid; nsnumber *_uid; } @property (nonatomic,retain) nsstring *sessionid; @property (nonatomic,retain) nsnumber *userid;
and init method:
- (id)initwithdictionary:(nsdictionary*)dict { if ((self = [super init])) { nsdictionary *mapping = [self elementtopropertymappings]; (nsstring *key in mapping) [self setvalue:[dict objectforkey:key] forkey:[mapping objectforkey:key]]; } return self; }
but @ method, called notification, i'm receiving broken newsession
object - properties ssid
, uid
invalid summaries:
-(void)didopensession:(nsnotification *)newsession { if (receivedsession) [receivedsession release]; receivedsession = [[newsession userinfo] objectforkey:@"session"]; }
where fault?
code looks ok me... have verified ivsession object contains expect to, after assembling things, prior posting notification?
Comments
Post a Comment