title: Cocoa: Call App Delegate Method from another Class
body: <p>I'm currently trying to get the path of a file from a drag and drop operation inside of a custom view, and then pass that path to my app delegate. I'm currently using the following:</p>
  
  <pre><code>- (BOOL)performDragOperation:(id &lt;NSDraggingInfo&gt;)sender 
  {
  
      NSPasteboard *pb = [sender draggingPasteboard];
      NSString *type = [pb availableTypeFromArray:[NSArray arrayWithObject:NSFilenamesPboardType]];
      NSArray *array = [[pb stringForType:type] propertyList];
  
      //access the app delegate
      NSApplication *myApplication;
      myApplication = [NSApplication sharedApplication];
  
      [myApplication uploadFiles:array];
  
      return NO;
  
  } 
  </code></pre>
  
  <p>However, I keep getting a message that says that my app delegate doesn't respond to the "uploadFiles" method. It is declared inside of my app delegate. Am I accessing the NSApplication in the correct manner?</p>
  
  <p>Thanks.</p>