Re: NSOperationQueue
Re: NSOperationQueue
- Subject: Re: NSOperationQueue
- From: Graham Cox <email@hidden>
- Date: Sun, 03 Jun 2012 17:57:11 +1000
On 03/06/2012, at 5:29 PM, Charles Srstka wrote:
> Since you’ve evidently already figured out a way to determine what images are visible in the view, just set up an NSMapTable or an NSDictionary mapping image URLs to operations, and then you know which operations correspond to the visible images. Prioritize those.
That's still not the problem.
The problem is you do not get, from moment to moment, information from the view that the visible items have changed. Given such a change, there are numerous ways I could go through the operations and reprioritise them.
Right now, what I actually do is to hold the operations in a queue of my own, and only feed them to the actual NSOperationQueue when a timer fires and the queue has some capacity. At that point I am able to reprioritise the pending operations (including those already queued but not yet executing). But I have to do it by effectively polling through them with a timer, rather than doing it on some sort of notification that the view has moved, which is a bit kludgey.
>
> Although, given what you’ve said thus far, I’m beginning to think that Kyle may be right and that IKImageBrowserView might not be the best tool for what you’re trying to do.
>
Indeed. I have turned off my SVG stuff altogether and I still get the deep crash. I cut down the number of acceptable image types to just JPEG, PNG, and PDF and I don't get the crash, but I get new weird stuff happening, e.g. suddenly I get:
-[NSWindowController loadWindow]: failed to load window nib file 'MainDocument'.
after scrolling around the IKImageBrowserView for a while and I try to open a new document. This smells to me of memory corruption, since otherwise these two parts of the app are unrelated, and for these image types, I defer 100% to Cocoa's implementation.
I think the evidence points to IKImageBrowserView still being buggy even after all this time, so I think I'm going to have to ditch it, if only to obtain some stability in my app and some sanity in myself.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden