Is there a best practice code example demonstrating how to use the
ALAssetsLibrary, specifically with adding new asset groups and adding photos
to them?


I've seen a few samples out there, but none of them seem to handle the async
nature of these methods properly and I am running into difficulty with what
should be an extremely simple task.


In the code example below, 50% of the time the newly added group has one or
more null property values, preventing the image from being added to the new
group. According to Apple's docs, you are supposed to do "work" with the
object received in the block but I can't see how you can when it is in an
invalid state.


I set up an observer to detect when the "ALAssetsLibraryChangedNotification"
gets fired to reload (as suggested on SO) and determined that there were
many times this notification did not get fired between the time of the call
and the addition of the new object which was returned in an invalid state.


I've tried re-enumerating after adding with sleep timers and pulling the
object out that way, but apparently it still wasn't "ready" with all of it's
property values yet.




There has to be an easy way to do this. Appreciate any help!




--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/ALAssetsLibrary-AddAssetsGroupAlbum-Block-Returns-Invalid-ALAssetsGroup-Object-tp4655909.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to