title: Is it possible to declare an Objective-C method outside a class?
body: <p>I know that you can declare a C function outside of a class, but is it possible to declare a Objective-C method outside of a class?</p>
  
  <p>Example:</p>
  
  <pre><code>// Works
  void printHelloC()
  {
      NSLog(@"Hello.");
  }
  
  // Error
  -(void) printHelloOC
  {
      NSLog(@"Hello.");
  }
  
  int main (int argc, const char * argv[])
  {
      @autoreleasepool {
          printHelloC();
          [self printHelloOC];// 'self' obviously would not work but you get the idea
      }
      return 0;
  }
  </code></pre>