に到着しました:NSNotification iは、このように通知を掲示しています壊れたオブジェクト
...
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
d uid
は無効なサマリーです:
-(void)didOpenSession:(NSNotification *)newSession
{
if (receivedSession)
[receivedSession release];
receivedSession = [[newSession userInfo] objectForKey:@"session"];
}
どこが私の過ちですか?
IVNewSessionNotificaitonは間違っています – titaniumdecoy