I'm seeing the following error

2008-03-17 12:42:11.916 MyApp[11155] *** Assertion failure in - [MyOutlineView lockFocus], AppKit.subproj/NSView.m:3248 2008-03-17 12:42:11.917 MyApp[11155] lockFocus sent to a view whose window is deferred and does not yet have a corresponding platform window

when calling

[myScrollView setDocumentView:theOutlineView];

It's not quite that straightforward of course.

My app has four different view types (tree, browser, graphical, duplicates) for each volume (disk), which the user can swap between.

These views are created lazily, and swapped in and out when the user swaps view types, or selects a different volume using

[myScrollView setDocumentView:theOutlineView];

The views are stored in a dictionary when not in use.

When a user rescans the disk, the old data, that is displayed in the views in various formats, is thrown away.

I'm seeing the above problem with the duplicates view, which is an NSOutlineView, when I

1) swap to the duplicates outline view.
2) scan the disk (creating the data).
3) swap to a different view.
4) rescan the disk (resetting the data).
5) swap back to the duplicates view.

When the data is reset, the views data source is not changed. Rather, the object that the datasource grabs its data from is reset, and [myOutlineView reloadData] is called immediately.

At the point the error occurs, there is no actual data in the duplicates outline (as it generates its own dupes data, and it throws the exception before getting to that point second time around).

Steps 1 and 2 can be swapped with no effect on the outcome.

I don't get any problem if the duplicates NSOutlineView is visible when the data is reset and repopulated (i.e. if I skip step 3) - everything works fine.

To sum up, reloading the data while the view is offscreen seem to be the somehow connected to this.

I can reproduce this 100% of the time, but haven't had a chance to distil a redistributable test case yet. I don't get the problem at all on Leopard.

I'm pretty sure I'll pin it down eventually, but if anyone has seen anything like this, or has a workaround, that would be great. From the Leopard fix, I'm guessing that it was a known issue in Tiger.















_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to