Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8176145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:03:04+00:00 2026-06-06T23:03:04+00:00

<><> —- Aalok has answered this question, I’m just waiting for him to write

  • 0

<><> —-
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];
—– <><>

<><> —– EDIT 2: You do not need to stop and restart the AV session, tested this thoroughly and it’s working perfectly. —– <><>

<><> —– 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 —– <><>

I’m using the category in this link to try to save to a custom folder:

http://www.touch-code-magazine.com/ios5-saving-photos-in-custom-photo-album-category-for-download/

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:

    if ([group valueForProperty:ALAssetsGroupPropertyURL] == nil)
{
NSLog(@”group properties are nil!”);
} else {
[group addAsset:asset];
}

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.

Any ideas? Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:03:06+00:00Added an answer on June 6, 2026 at 11:03 pm

    I have facing the same problem with this same .h and .m file but find one solution for this after working on it for 2 to 3 days and the solution is very simple what I have to change is in .m file in

    -(void)saveImage:(UIImage*)image toAlbum:(NSString*)albumName withCompletionBlock:(SaveImageCompletion)completionBlock

    and in

    -(void)addAssetURL:(NSURL*)assetURL toAlbum:(NSString*)albumName withCompletionBlock:(SaveImageCompletion)completionBlock

    methods i just add this before calling the inside methods

    //THE CHANGE dispatch_async(dispatch_get_main_queue(),^{ //
    [self writeImageToSavedPhotosAlbum:image.CGImage orientation:(ALAssetOrientation)image.imageOrientation completionBlock:^(NSURL* assetURL, NSError* error) 
        {
            //error handling
            if (error!=nil) 
            {
                completionBlock(error);
                return;
            }
            //add the asset to the custom photo album
            [self addAssetURL: assetURL toAlbum:albumName withCompletionBlock:completionBlock];
        }];
    //THE CHANGE }); //
    

    AND Same for the other one

    Happy Coding 🙂

    EDIT

    In second method I add a line below every completionBlock(nil); line

    [[NSNotificationCenter defaultCenter] postNotificationName:kSaveSuccess object:nil];
    

    And I use this notification to make sure that image is saved in album too. Till that time I Shows UIActivityIndicator with some text message and after successfully saved image one popup message is shown indicated that image is saved in album with album name. And while this time the UI is unresponsive i.e. user can’t do any thing other then pressing home button of device 🙂 😉

    Happy Coding 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, is there a way to write a.children('.outer').children('.inner') without the intermediate selector? I can't
I'm including a local class that requests a file from a remote server. This
This is a follow-up to the question: Should the folders in a solution match
This is an interesting problem that I have searched here and all over my
I recently ran against a very interesting site that expresses a very interesting idea
I'm trying to create a chrome extension and im doing this by parsing an
I have set of xml elements like this: <item code=<HTML_CODE> /> For example: <items>
InDesign can export an XML file, and it will also Remap break, whitespace, and
&mdash; or &#8212; Is there a difference between these? Is one better-supported than the
I'm currently working on a little harvester, using this dataset of 2700 foundations .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.