Re: Crashing Problem calling postNotificationName
Re: Crashing Problem calling postNotificationName
- Subject: Re: Crashing Problem calling postNotificationName
- From: Dave <email@hidden>
- Date: Thu, 12 Sep 2013 20:53:31 +0100
Hi,
Something that may be confusing people is that although LTWCachedNotificationCenter is defined as Sublass of NSNotificationCenter, it does NOT allocate itself as an object and it does not call Super, instead it calls [NSNotificationCenter defaultCenter] as in:
- (void)postNotificationName:(NSString*) theName object:(id) theObject userInfo:(NSDictionary*) theUserInfoDictionary
{
[[NSNotificationCenter defaultCenter] postNotificationName:theName object:theObject userInfo:theUserInfoDictionary];
if (theUserInfoDictionary == nil)
return;
@synchronized (gNotificationClassDictionary)
{
[gNotificationClassDictionary setObject:theUserInfoDictionary forKey:theName];
}
}
+(void) repostNotiticationName:(NSString*) theName
{
NSDictionary* myUserInfoDictionary;
@synchronized (gNotificationClassDictionary)
{
myUserInfoDictionary = [gNotificationClassDictionary objectForKey:theName];
}
if (myUserInfoDictionary != nil)
[[NSNotificationCenter defaultCenter] postNotificationName:theName object:nil userInfo:myUserInfoDictionary];
}
All the Best
Dave
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden