Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.54 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Cocoa Singletons and Protocols
  2. [NSUserDefaults standardUserDefaults]
  3. [NSNotificationCenter defaultCenter]
  4.        
  5. @protocol ConfigurationManager <NSObject>
  6.  
  7. //...
  8.  
  9. @interface ConfigurationManagerFactory : NSObject
  10.  
  11. + (id<ConfigurationManager>)sharedConfiguration;
  12.  
  13. @end
  14.  
  15. // ...
  16.  
  17. id<ConfigurationManger> config = [ConfigurationManagerFactory sharedConfiguration];
  18. [config ...];
  19.        
  20. @protocol ConfigurationManager <NSObject> ...
  21.  
  22. @interface ConfigurationManager : NSObject <ConfigurationManager>
  23. +(ConfigurationManager *) defaultConfigurationManager;
  24. ...