• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: MLMediaLibrary sometimes does not call my KVO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MLMediaLibrary sometimes does not call my KVO


  • Subject: Re: MLMediaLibrary sometimes does not call my KVO
  • From: Graham Cox <email@hidden>
  • Date: Fri, 23 Sep 2016 09:09:35 +1000

> On 22 Sep 2016, at 10:45 PM, Gabriel Zachmann <email@hidden> 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 (https://developer.apple.com/reference/appkit/nsmedialibrarybrowsercontroller?language=objc) 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.

—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


References: 
 >MLMediaLibrary sometimes does not call my KVO (From: Gabriel Zachmann <email@hidden>)
 >Re: MLMediaLibrary sometimes does not call my KVO (From: Graham Cox <email@hidden>)
 >Re: MLMediaLibrary sometimes does not call my KVO (From: Gabriel Zachmann <email@hidden>)

  • Prev by Date: Re: Stupid objective-c question
  • Next by Date: Re: Stupid objective-c question
  • Previous by thread: Re: MLMediaLibrary sometimes does not call my KVO
  • Next by thread: Stupid objective-c question
  • Index(es):
    • Date
    • Thread