title: Why is my target not printing to the console?
body: <p>I just started learning targets, and have followed all the instructions to create my first console app which should print "Ouch!" every two seconds, but although it is looping it isn't printing to the console and I can't figure out why. Would someone mind telling me what I am doing wrong?</p>
  
  <p>My .h file has the following:</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  
  @interface Logger : NSObject
  
  - (void)sayOuch:(NSTimer *)t;
  
  @end
  </code></pre>
  
  <p>My .m file has the following:</p>
  
  <pre><code>#import "Logger.h"
  
  @implementation Logger
  
  
  - (void)sayOuch:(NSTimer *)t
  {
      NSLog(@"Ouch!");
  }
  
  
  @end
  </code></pre>
  
  <p>And finally, my main.m file contains the following:</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  #import "Logger.h"
  
  int main (int argc, const char * argv[])
  {
  
      @autoreleasepool {
  
  
          Logger *logger = [[Logger alloc] init];
          __unused NSTimer *timer = [NSTimer timerWithTimeInterval:2.0 
                                                   target:logger 
                                                 selector:@selector(sayOuch:) 
                                                 userInfo:nil 
                                                  repeats:YES];
          [[NSRunLoop currentRunLoop] run];
  
      }
      return 0;
  }
  </code></pre>
  
  <p>The thing is, whenever I run the message "Ouch!" is not printing to my console. Thanks for the help in advance.</p>