Telling IKImageBrowserView not to schedule preloading

谁说我不能喝 提交于 2019-12-03 20:53:30

I've been starting to use IKImageBrowserView myself, and I hadn't noticed this before, but indeed I tried it out and am seeing the same behavior with my own app.

It looks like there's a private method on IKImageBrowserView called _shouldProcessLongTasks. I tried overriding it to just return NO, and that appears to prevent the preloading behavior for images that aren't yet visible in the view (at least under Snow Leopard, would have to test under Leopard to see if the behavior is the same). Seems like a fairly low-risk private API usage, since if the method changes, it simply won't be called anymore. When you file a bug with Apple on this, do post the radar number so others affected can file a dupe on it and try to get a public API and/or behavior change for this.

For the record, it looks like the current behavior is that it will prefetch stuff in the background as long as the application is in the foreground and the window containing the view is key. If you switch to another app or window, then it stops preloading.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!