Hello,

I have an OutlineView. Whenever I drag and drop a child item within the Outline-View my application crashes when I open do an "NSAlert runModal" like in the code below:

- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id < NSDraggingInfo >)info item:(id)item childIndex:(NSInteger)index
{
    ...
1    if(needToAskUser)
     {
2        NSAlert *alert = [[NSAlert alloc] init];
3        // .. set some texts and buttons in alert
4       [alert runModal];
     }
}

In line 4 the app crashes with the following uncaught exception:
[General] -[NSAlert runModal] may not be invoked inside of transaction begin/commit pair, or inside of transaction commit (usually this means it was invoked inside of a view's -drawRect: method.)

I have a tree like this:
Top Level 1
  - Child Item A
  - Child Item B
Top Level 2
  - Child Item C
...

The problem occurs only, when I drag one of the Child Items within the same view. It does not matter whether I move Child Item A below Child Item B or if I move it to another Top Level item, for example below Child Item C.

Moving the block into a call to dispatch_async(dispatch_get_main_queue(), ^{ }); did also not help.

Has anyone any idea what the problem is?
Best regards,
Michael Kloske

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to