Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 930267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:18:22+00:00 2026-05-15T20:18:22+00:00

I am doing drag and drop with NSView. In the object to be dragged,

  • 0

I am doing drag and drop with NSView.

In the object to be dragged, which is subclass of NSView, I implemented mouseDown: method as follows:

@try {
    NSPoint location; 
    NSSize size ;
    NSPasteboard *pb = [NSPasteboard pasteboardWithName:@"CameraIconContainer"];

    location.x =  ([self bounds].size.width - size.width)/2 - 21.0;
    location.y =  ([self bounds].size.height - size.height)/2 - 7.0;

    NSLog(@"mouseDown: location- (%f, %f)",location.x,location.y);


    NSDictionary *iconViewDict = [[NSDictionary alloc] initWithObjectsAndKeys:[cameraNo stringValue],@"cameraNo",nil];
    NSLog(@"iconViewDict - %@",iconViewDict);

    NSData *data = [NSKeyedArchiver archivedDataWithRootObject:iconViewDict];


    [pb declareTypes:[NSArray arrayWithObject:IconDragDataType] owner:self];
    [pb setData:data forType:IconDragDataType];
    [self dragImage:[NSImage imageNamed:@"camera_icon.png"] at:location offset:NSZeroSize event:e pasteboard:pb source:self slideBack:YES];
}
@catch (NSException * e) {
    NSLog(@"CameraIconView (-mouseDown:), error - %@",e);
}

Most of the time it is working fine but problem is- sometimes it is raising this

exception:Invalid parameter not
satisfying: theWriteStream != NULL

in the mouseDown: method, because of it the dragged image continuously appears over screen, which does not disappear even if some other window is selected.

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

Thanks,

Miraaj

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T20:18:23+00:00Added an answer on May 15, 2026 at 8:18 pm
    exception:Invalid parameter not satisfying: theWriteStream != NULL
    

    That sort of exception comes from an assertion. Something is about to try to write to a stream, and asserted that it has a stream to write to. When the assertion fails, that means that the condition was untrue; in this case, it means that it did not have a stream to write to.

    I don’t see any stream-related code in the sample you provided, so it’s either somewhere else in your app or somewhere within a framework you’re using. You should turn on “Stop on Objective-C exceptions” in Xcode, then run your app under the debugger until the exception occurs, then look at the stack trace in the debugger to see exactly what threw the exception.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing drag/drop out of an activeX control. On drag, I provide a CComQIPtr
I have a WinForms application where I'm doing drag and drop between 2 TreeViews.
I am implementing an application which can be drag and drop images in a
I'm doing some Drag and Drop operations, and I want to use a visual
Trying an example piece of code for Scriptaculous for doing some drag and drop.
I am doing a little app with JQuery, using drag-n-drop for the interface. Basically,
I have a WPF 4 application where I have implemented Drag and Drop using
I'm doing a drag and drop module now, and I need to get the
When doing thread synchronization in C# should I also lock an object when I
Are there open source libraries for Java to make implementation of drag and drop

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.