title: Delegate in singleton won't work
body: <p>I have a singleton that downloads data from an exterior database (PTDatabaseAccsesser).
  When all data has been downloaded the singleton should call on a delegate which is a subclass of UITableViewController. However, i get this error:</p>
  
  <pre><code>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:
  '-[__NSCFType doneDownloadingData]: unrecognized selector sent to instance... 
  </code></pre>
  
  <p>This is how I set the delegate to the subclass of UITableViewController:</p>
  
  <pre><code>- (void)viewDidLoad {
  
      [[PTDatabaseAccesser sharedInstance] setDelegate:self];
      NSLog(@"%@", [[PTDatabaseAccesser sharedInstance] delegate]);
  }
  </code></pre>
  
  <p>The NSLog shows that everything is correct here.</p>
  
  <p>This is the code from the PTDatabaseAccsesser that calls on the delegate:</p>
  
  <pre><code>NSLog(@"%@", [self delegate]);
  [[self delegate] doneDownloadingData];
  </code></pre>
  
  <p>The NSLog here however is showing that the delegate is of the same type as in the error message above.</p>
  
  <p>This is how I create the singleton:</p>
  
  <pre><code>static PTDatabaseAccesser *sharedInstance;
  
  + (PTDatabaseAccesser *)sharedInstance {
  
      @synchronized(self) {
  
          if (!sharedInstance) sharedInstance = [[PTDatabaseAccesser alloc] init];
      }
  
      return sharedInstance;
  }
  
  + (id)alloc {
  
      @synchronized(self) {
  
          sharedInstance = [super alloc];
      }
  
      return sharedInstance;
  }
  </code></pre>
  
  <p>I have made sure that the singleton works by using breakpoints in the two method implementations above.</p>