Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS5 Saving images to custom folder, ALAssetsLibrary fail
    primarykey
    data
    text
    <p><strong>&lt;>&lt;> ---- Aalok has answered this question, I'm just waiting for him to write it up so I can chose that as the correct answer. Until then, along with making the changes he describes below I had to call -- self.library = [[ALAssetsLibrary alloc] init]; -- before every attempt to save my image. As a precaution I also stopped the AVSession running until after the save, when is was restarted (using [session stopRunning]; and [session startRunning]; ----- &lt;>&lt;></strong></p> <p><strong>&lt;>&lt;> ----- EDIT 2: You do not need to stop and restart the AV session, tested this thoroughly and it's working perfectly. ----- &lt;>&lt;></strong></p> <p><strong>&lt;>&lt;> ----- EDIT 3: after testing this on my device thoroughly, and it working perfectly, the code is not working once it's been through the review process and put on the store. Two identical devices (2x iPhone 4) running the same OS, one using my dev build, one off the app sotre, the ap store version still has the bug. Giving up with this for now ----- &lt;>&lt;></strong></p> <p>I'm using the category in this link to try to save to a custom folder:</p> <p><a href="http://www.touch-code-magazine.com/ios5-saving-photos-in-custom-photo-album-category-for-download/" rel="nofollow">http://www.touch-code-magazine.com/ios5-saving-photos-in-custom-photo-album-category-for-download/</a></p> <p>Now it works some of the time, but not all. In the comments it's been suggested that the following code will detect if the group properties are nil:</p> <pre><code> if ([group valueForProperty:ALAssetsGroupPropertyURL] == nil) { NSLog(@”group properties are nil!”); } else { [group addAsset:asset]; } </code></pre> <p>Which I have, and it does detect if the properties are nil. So all good. What I'm struggling with is at that point setting the properties and saving the images. I'm guessing that at this point we can manually set the albumName and save the image, which I've tried, but the error still occurs.</p> <p>Any ideas? Thank you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload