title: How can I animate a NSImage easily?
body: <p>I created a NSView within a NSImage which I want to animate by sending start and stop notifications via NSNotificationCenter.</p>
  <p>Which way do I have to take to realize this?</p>
  <p>The code I have is:</p>
  <pre><code>@implementation SyncToolbarItemView
  
  - (id)init
  {
      self = [super initWithFrame:CGRectMake(0.0f, 0.0f, 32.0f, 32.0f)];
      if (self)
      {
          // Initialization code here.
      
          // Add observers
          [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startSyncing) name:NOTIFICATION_START_CHECK_TAG_PROCESS object:nil];
          [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(stopSyncing) name:NOTIFICATION_FINISHED_CHECK_TAG_PROCESS object:nil];
      }
  
      return self;
  }
  
  - (void)drawRect:(NSRect)dirtyRect
  {
      // Init image
      img_sync = [[NSImageView alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, 32.0f, 32.0f)];
      [img_sync setImage:[NSImage imageNamed:@&quot;icon_sync.png&quot;]];
  
      // Add to view
      [self addSubview:img_sync];
  
      [img_sync release];
  }
  
  - (void) startSyncing
  {
  
  }
  
  - (void) stopSyncing
  {
  
  }
  
  @end
  </code></pre>