I have a ServiceFacade
class with class methods for communicating with backend services.
On that ServiceFacade
class I have a static method that returns NSMutableDictionary
in which I keep current ServiceFacade
's downloading operations.
I want to observer changes on this NSMutableDictionary
either in AppDelegate
or any other place. The app delegate seems not to respond to
- (void)addObserver:(NSObject *)anObserver
forKeyPath:(NSString *)keyPath
options:(NSKeyValueObservingOptions)options
context:(void *)context{
}
Method for returning NSMutableDictionary:
+(NSMutableDictionary *)downloadOperations
{
if (_downloadOperations)
{
return _downloadOperations;
}
[_downloadOperations addObserver:[AppDelegate sharedAppDelegate] forKeyPath:@"downloadOperationsDict" options:0 context:NULL];
_downloadOperations = [NSMutableDictionary dictionary];
return _downloadOperations;
}
Any idea ?