title: kCGErrorFailure while performing drag and drop in NSView
body: <p>I have created a simple drag and drop application in which I am sometimes getting this exception msg, displayed in debugger console:</p>
  
  <blockquote>
    <p>kCGErrorRangeCheck:
    CGSNewWindowWithOpaqueShape: Cannot
    create window</p>
    
    <p>kCGErrorFailure: Set a breakpoint @
    CGErrorBreakpoint() to catch errors as
    they are logged.</p>
    
    <p>kCGErrorIllegalArgument:
    CGSMoveWindow: Invalid window 0x0</p>
    
    <p>kCGErrorIllegalArgument:
    CGSOrderWindowList</p>
    
    <p>kCGErrorIllegalArgument:
    CGSOrderWindowList</p>
    
    <p>kCGErrorIllegalArgument:
    CGSGetWindowBounds: NULL window</p>
    
    <p>kCGErrorIllegalArgument:
    CGSMoveWindow: Invalid window 0x0</p>
    
    <p>kCGErrorIllegalArgument:
    CGSOrderWindowList</p>
    
    <p>kCGErrorIllegalArgument:
    CGSGetWindowBounds: NULL window</p>
  </blockquote>
  
  <p>Can anyone suggest me why is it occurring and how can I resolve it? </p>
  
  <p>Also can anyone suggest how to set breakpoint for @CGErrorBreakpoint() so that I can debug and trace its cause?</p>
  
  <p>The code in concludeDragOperation is:</p>
  
  <pre><code>NSPoint dropLocation = [sender draggedImageLocation];
  id dragSource = [sender draggingSource];
  NSPasteboard *pb = [sender draggingPasteboard];
  NSData *draggedData = [pb dataForType:IconDragDataType];
  id unarchievedObject = [NSKeyedUnarchiver unarchiveObjectWithData:draggedData];
  [unarchievedObject setFrameOrigin:dropLocation];
  </code></pre>
  
  <p>Thanks,</p>
  
  <p>Miraaj</p>