title: Unrecognized selector when adding an object to NSMutableArray
body: <p>I have a singleton class with a NSMutableArray property to which I want to add objects and remove objects. For some reason I am getting: </p>
  
  <pre><code>-[__NSDictionaryI setObject:forKey:]: unrecognized selector sent to instance 0x1edf24c0
  </code></pre>
  
  <p>exception when trying to add to it. Here is the relevant code for the interface of the singleton:</p>
  
  <pre><code>//outbox item is the type of objects to be held in the dictionary
  @interface OutboxItem : NSObject
  @property (nonatomic, assign) unsigned long long size;
  @end
  
  @interface GlobalData : NSObject
  @property (nonatomic, copy) NSMutableDictionary *p_outbox;
  + (GlobalData*)sharedGlobalData;
  @end
  </code></pre>
  
  <p>The implementation of the singleton:</p>
  
  <pre><code>@implementation GlobalData
  @synthesize  p_outbox;
  static GlobalData *sharedGlobalData = nil;
  + (GlobalData*)sharedGlobalData {
      if (sharedGlobalData == nil) {
          sharedGlobalData = [[super allocWithZone:NULL] init];
          sharedGlobalData.p_outbox = [[NSMutableDictionary alloc] init];
      }
      return sharedGlobalData;
  }
  
  + (id)allocWithZone:(NSZone *)zone {
      @synchronized(self)
      {
          if (sharedGlobalData == nil)
          {
              sharedGlobalData = [super allocWithZone:zone];
              return sharedGlobalData;
          }
      }
      return nil;
  }
  - (id)copyWithZone:(NSZone *)zone {
      return self;
  }
  @end
  </code></pre>
  
  <p>And here is the code that throws the exception:</p>
  
  <pre><code>GlobalData* glblData=[GlobalData sharedGlobalData] ;
  OutboxItem* oItem = [OutboxItem alloc];
  oItem.size = ...;//some number here
  [glblData.p_outbox setObject:oItem forKey:...];//some NSString for a key
  </code></pre>
  
  <p>Am I missing something very obvious??</p>