assetslibrary

ALAssetsLibrary delete ALAssetsGroup / ALAsset

烂漫一生 提交于 2019-11-28 09:26:45
I have created "photos album" from my App, using IOS AssetsLibrary. Reading ALAssetsLibrary,ALAssetsGroup and ALAsset documentations, i have seen methods to "addAsset","addAssetsGroupAlbumWithName". Is there a way to delete PROGRAMMATICALLY my ALAssetsGroup and ALAsset. (the property 'editable' suppose to be TRUE because i create this data). This is not possible using any documented API. Only the photos app can delete Albums. If you want this feature to be added to iOS, I would fill a feature request at http://radar.apple.com . You can only delete the ALAsset which is created by your app with

iOS ALAssetsLibrary and NSFileHandle reading file contents

谁说胖子不能爱 提交于 2019-11-28 05:36:23
问题 I want to read the contents of an assets library file in iOS NSFileHandle fileHandleForReadingFromUrl using the asset defaultRepresentation url seems to always return 0x0 ... I'll keep looking for a solution in the mean time. EDIT: Looks like the answer from Anomie might be what I want: NSUInteger length = [representation getBytes:bytes fromOffset:0 length:[representation size] error:&error]; 回答1: For larger files you probably want to copy out via a loop to read X bytes in chunks, otherwise

Saving Geotag info with photo on iOS4.1

↘锁芯ラ 提交于 2019-11-27 06:56:09
I am having major issues trying to save a photo to camera roll with geotag info on iOS4.1. I am using following ALAssetsLibrary API: - (void)writeImageDataToSavedPhotosAlbum:(NSData *)imageData metadata:(NSDictionary *)metadata completionBlock:(ALAssetsLibraryWriteImageCompletionBlock)completionBlock I have the GPS coordinates that i wish to save with the photo as an input. Unfortunately, there is no documentation or sample code that describes how to form the metadata NSDictionary that encapsulates the GPS coordinates. Can somebody post a sample code that is known to work ? I have also tried

App killed by SIGKILL when changing privacy settings

荒凉一梦 提交于 2019-11-27 03:30:21
My iOS app accesses the user's Photos with ALAssetsLibrary . When I change the privacy settings for the app (Settings → Privacy → Photos), the app gets killed by system ( SIGKILL ). Is this a bug? I think it is a bug or at least poorly documented and unexpected behavior. But it does not crash it is just forced to restart. You will get a SIGKILL message but no Crash log. If you are a registered apple developer you can check their forums for discussions about this issue https://devforums.apple.com/message/715855 https://devforums.apple.com/message/714178 I don't know of any way how to prevent

Saving Geotag info with photo on iOS4.1

我与影子孤独终老i 提交于 2019-11-26 17:36:13
问题 I am having major issues trying to save a photo to camera roll with geotag info on iOS4.1. I am using following ALAssetsLibrary API: - (void)writeImageDataToSavedPhotosAlbum:(NSData *)imageData metadata:(NSDictionary *)metadata completionBlock:(ALAssetsLibraryWriteImageCompletionBlock)completionBlock I have the GPS coordinates that i wish to save with the photo as an input. Unfortunately, there is no documentation or sample code that describes how to form the metadata NSDictionary that

App killed by SIGKILL when changing privacy settings

余生长醉 提交于 2019-11-26 12:39:07
问题 My iOS app accesses the user\'s Photos with ALAssetsLibrary . When I change the privacy settings for the app (Settings → Privacy → Photos), the app gets killed by system ( SIGKILL ). Is this a bug? 回答1: I think it is a bug or at least poorly documented and unexpected behavior. But it does not crash it is just forced to restart. You will get a SIGKILL message but no Crash log. If you are a registered apple developer you can check their forums for discussions about this issue https://devforums