Closed djrossi closed 13 years ago
I just found out that you need to enable location services to access the user's photo library. After enabling core location, all of the photos loaded as expected.
I'm having the same problem even after enabling location services (Settings->General->Location Services->On) on my iOS 4.2.1 device. Anyone find an alternative solution to this?
You have to enable location services for your application, and ask for permission from the user. Enable location services in the settings application will not solve it.
Thanks for the reply. I googled for a while and found the reason: it appears that [ALAssetsLibrary enumerateGroupsWithTypes:] fails if it is executed on a thread that is not the main thread. Enclosing the function in dispatch_async(dispatch_get_main_queue() seems to solve the bug.
The details are documented here: https://devforums.apple.com/message/323036#323036 and http://stackoverflow.com/questions/4200552/assets-library-framework-not-working-correctly-on-4-0-and-4-2
The navigation bar continues to say "Loading..." and it never retrieves the photos from the library. It works fine in the simulator.