2

I have created a simple drag and drop application in which I am sometimes getting this exception msg, displayed in debugger console:

kCGErrorRangeCheck: CGSNewWindowWithOpaqueShape: Cannot create window

kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.

kCGErrorIllegalArgument: CGSMoveWindow: Invalid window 0x0

kCGErrorIllegalArgument: CGSOrderWindowList

kCGErrorIllegalArgument: CGSOrderWindowList

kCGErrorIllegalArgument: CGSGetWindowBounds: NULL window

kCGErrorIllegalArgument: CGSMoveWindow: Invalid window 0x0

kCGErrorIllegalArgument: CGSOrderWindowList

kCGErrorIllegalArgument: CGSGetWindowBounds: NULL window

Can anyone suggest me why is it occurring and how can I resolve it?

Also can anyone suggest how to set breakpoint for @CGErrorBreakpoint() so that I can debug and trace its cause?

The code in concludeDragOperation is:

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];

Thanks,

Miraaj

2
  • What class is unarchievedObject?
    – sbooth
    Jul 23, 2010 at 13:46
  • it is subclass of NSView, in its mouseDown: method I am initiating the drag operation
    – Devarshi
    Jul 26, 2010 at 4:46

1 Answer 1

2

To set a breakpoint in CGErrorBreakpoint open the breakpoints window (command-option-B), double-click on the line that says "Double-Click for Symbol" and enter CGErrorBreakpoint in the text field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.