Я отправляю уведомление следующим образом:
...
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 IVSession : IVMappableObject {
NSString *_ssid;
NSNumber *_uid;
}
@property (nonatomic,retain) NSString *sessionID;
@property (nonatomic,retain) NSNumber *userID;
и метод init:
- (id)initWithDictionary:(NSDictionary*)dict
{
if ((self = [super init]))
{
NSDictionary *mapping = [self elementToPropertyMappings];
for (NSString *key in mapping)
[self setValue:[dict objectForKey:key] forKey:[mapping objectForKey:key]];
}
return self;
}
но в методе, вызываемом для этого уведомления, я получаю поврежденный newSession
объект - его свойства ssid
и uid
являются недопустимыми сводками:
-(void)didOpenSession:(NSNotification *)newSession
{
if (receivedSession)
[receivedSession release];
receivedSession = [[newSession userInfo] objectForKey:@"session"];
}
где моя вина?