Re: Crashing Problem calling postNotificationName
Re: Crashing Problem calling postNotificationName
- Subject: Re: Crashing Problem calling postNotificationName
- From: Graham Cox <email@hidden>
- Date: Thu, 12 Sep 2013 11:28:11 +0200
On 12/09/2013, at 11:17 AM, Etienne Samson <email@hidden> wrote:
> If there's 26 different objects that need that "cache" capacity, that's 26 class methods
So just make a tiny class for the sole purpose of storing the latest data state. All 26 different sender classes can then use it - since it only stores one thing, it must be "the latest", by definition.
It does not make any difference to the loose coupling, you're just substituting a different global class for NSNotificationCenter. It does require minor code changes to 26 different classes, but that's a small price to pay for correctness/simplicity/no side effects over a hack, in my opinion.
--Graham
_______________________________________________
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