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

  • Home
  • SEARCH
  • 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 5974621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:58:05+00:00 2026-05-22T20:58:05+00:00

I have generated JPG image, saved to Documents folder, that not comes with bundle.

  • 0

I have generated JPG image, saved to Documents folder, that not comes with bundle.
Please help with the building class for saving it to Gallery.

Finnaly with help of kviksilver

To make complete solution:

// tools.h

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface tools : NSObject {

}

@end

// tools.m

#import "tools.m"

@implementation tools

-(IBAction)saveImage{

    NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory=[paths objectAtIndex:0];
    NSString *imagePath=[documentsDirectory stringByAppendingPathComponent:@"file7.jpg"];
    UIImage *image=[UIImage imageWithContentsOfFile:imagePath];
    UIImageWriteToSavedPhotosAlbum(image, self,@selector(savedPhotoImage:didFinishSavingWithError:contextInfo:), nil);
}
@end

In the end have to call it from CPP wrapper:

void onCPPSaveImgToCamRoll ( )
{
    return saveImage;
}
  • 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-05-22T20:58:06+00:00Added an answer on May 22, 2026 at 8:58 pm

    try getting imagePath like this:

    NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory=[paths objectAtIndex:0];
    NSString *imagePath=[documentsDirectory stringByAppendingPathComponent:@"Image.jpg"];
    

    then setting image:

     UIImage *image=[UIImage imageWithContentsOfFile:imagePath];
    UIImageWriteToSavedPhotosAlbum(image, self,@selector(savedPhotoImage:didFinishSavingWithError:contextInfo:), nil);
    

    savedPhotoImage:didFinishSavingWithError:contextInfo: will be called when finished saving or failing

    just create two methods in your class:

    -(void)saveImage{ 
    
    NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
    
    NSString *documentsDirectory=[paths objectAtIndex:0]; 
    
    NSString *imagePath=[documentsDirectory stringByAppendingPathComponent:@"Image.jpg"]; 
    
    UIImage *image=[UIImage imageWithContentsOfFile:imagePath]; 
    
    UIImageWriteToSavedPhotosAlbum(image, self,@selector(savedPhotoImage:didFinishSavingWithError:contextInfo:), nil);
    
    
    } 
    - (void)savedPhotoImage:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInf{ 
    
    // possible error handling
    
    }
    

    and you should be ok –

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

Sidebar

Related Questions

I have an action that returns a Dynamically Generated image however I need the
I need to generate thumbnails from a set of jpg's that need to have
I have generated class diagram by gight clicking and selecting generate class diagram usign
I have a generated txt file. This file has certain lines that are superfluous,
I have the following code: self.bg_br = mechanize.Browser() self.bg_br.retrieve(self.bg_imageurl, image2.jpg) self.bg_file2 = open(image.jpg, mode=w)
I have a css file that links to images. .test{ background: url(http://site.com/dynamic/test.jpg) no-repeat; }
I have a model that looks like this: public class Book { public string
I have been following a tutorial that remotely downloads an image to an imageview,
I have a bit of a mystery here that I am not quite understanding
I have generated a collection of images. Some of them are blank as in

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.