> On 22 Sep 2016, at 10:45 PM, Gabriel Zachmann <z...@tu-clausthal.de> wrote:
>> I’ve run into some unreliability in MLMediaLibrary. It appears to be a bug 
>> because it sometimes can be seen in places that use MLMediaLibrary within 
>> general standard components, such as NSOpenPanel (this adds a media browsing 
>> section if it is set up to allow image types, for example). 
> Thanks a lot for your insights.
> I am wondering: how does Microsoft Word , for instance, do it?
> I've never seen that application behave funny when it shows the image browser 
> (it faithfully shows all 10,000 images from my Photos library).
> Does it use a different API?

It’s very hard for a sandboxed app to get access to the internals of Photos 
without using MLMediaLibrary, though not too difficult for non-sandboxed. 
MLMediaLibrary was added because of this need.

There is a standard component - NSMediaLibraryBrowserController 
 that gives you a standardised panel for browsing. Unfortunately it’s a 
standalone panel rather than a view that you can embed within a larger UI, but 
it’s sufficient for many needs, and is easy to use. You could look at that and 
see if its behaviour is more reliable than your own code. I have tried it and 
it isn’t for me - I get the same problems with it that I see in NSOpenPanel, or 
when using KVO on MLMediaLibrary elements, which is why the problem seems to be 
in the lower-level layers of MLMediaLibrary.



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:

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

Reply via email to