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 7822033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:48:55+00:00 2026-06-02T07:48:55+00:00

I am trying to develop an application which would download images (from a photography

  • 0

I am trying to develop an application which would download images (from a photography site) and create a ALAsset for each image and then place them under a new ALAssetsGroup.

I am able to create a new Album (ALAssetsGroup) and download data from the website. However i am a bit stuck on how to create the new ALAsset.

I have tried is as follows

            ALAsset *asset = [[[ALAsset alloc] init] autorelease];
            NSDictionary *metadata = [NSDictionary dictionaryWithObjectsAndKeys:p.id, @"id", p.thumbnail_url, @"thumbnail_url", p.photo_url, @"photo_url", nil];
            [asset setImageData:data metadata:metadata completionBlock:^(NSURL *assetURL, NSError *error) {
                ESLog(@"Asset %@ created error:%@", assetURL, error);
                [group addAsset:asset];
            }];

However I get prints where both the assetURL and error is empty.

2012-04-15 02:58:06.850 XXXXXX.com[5966:c607] Asset (null) created error:(null)

It would be great if someone can suggest how i can create a new Asset in an Album

  • 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-02T07:48:56+00:00Added an answer on June 2, 2026 at 7:48 am

    you cant create a new ALAsset like that.
    What you need to do is save you image data to the Photo-Library using the method:

    - (void)writeImageDataToSavedPhotosAlbum:(NSData *)imageData metadata:(NSDictionary *)metadata completionBlock:(ALAssetsLibraryWriteImageCompletionBlock)completionBlock
    

    The completion block will return the NSURL for the new created asset. Using the method

    - (void)assetForURL:(NSURL *)assetURL resultBlock:(ALAssetsLibraryAssetForURLResultBlock)resultBlock failureBlock:(ALAssetsLibraryAccessFailureBlock)failureBlock
    

    with the NSURL will return you the ALAsset instance of the newly created asset.

    Cheers.

    Hendrik

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

Sidebar

Related Questions

I am trying to develop a custom gallery like application in which, i would
I am trying to develop a mobile application which can interact with a MOSS
I am trying to develop a Facebook application which shows me all the content
I am trying to develop a web application for which I need to capture
I am trying to develop an application that uses a number of images that
I am trying to develop an application that uses a number of images that
I'm trying to develop a web application that is going to be launched from
I am trying to develop an enterprise application which needs to list all the
I am trying to develop a non-web application (mobile, non-mobile) for consuming information from
I'm trying to develop an application that can stack FITS images. To read FITS

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.