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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:22:20+00:00 2026-06-17T05:22:20+00:00

i need to make app like penultimate. There should be a gallery and user

  • 0

i need to make app like penultimate. There should be a gallery and user can save pictures in it, not to camera roll. I already make drawing functions but can’t save images into app. I have’t any ideas how to do that. I already saw all questions like this in stack overflow. I don’t want to use core data and tableview.
So, if you know how to do that, please help me)))

  • 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-17T05:22:22+00:00Added an answer on June 17, 2026 at 5:22 am

    If you dont want use any databases. then have an option to save Images in ur Apps Document Directory and retrieve it from document Directory whenever needed.

    i have written some methods to save image into doc director and retrieve it in my app.

    These are as follows :
    in FileHandler.h I have declared these methods

    #import <Foundation/Foundation.h>
    
    
    @interface FileHandler : NSObject
    {
    
    }
    
    /* Property */
    @property (nonatomic, retain) NSString *dirPath;
    //@property (nonatomic, retain) NSString *fileName;
    
    /* init method */
    
    -(id)init;
    
    
    /* Other Contents */
    -(void)createImageFilterDirectory;
    
    -(void)createDirectoryAtPath:(NSString*)folderPath;
    
    -(NSString*)getFilteredImageFilePathWithFileName:(NSString*)fileName;
    
    -(void)saveImageToDocDir:(UIImage*)aImage  withFileName:(NSString*)file;
    
    -(UIImage*)getImageWithFileName:(NSString*)imageFileName;
    
    -(BOOL)removeImageWithFileName:(NSString*)fName;
    
    -(void)deleteAllDirContents;
    
    -(NSArray*)getAllDirContents;
    
    -(NSArray*)getAllImageFromDir;
    
    -(BOOL)deleteDir;
    
    @end
    

    and in FileHandler.m i have these methods defined:

    #import "FileHandler.h"
    
    #define ImageFilterDir   @"ImageFilterDir"
    
    @implementation FileHandler
    @synthesize dirPath;//, fileName;
    
    /* int implementation */
    -(id)init
    {
        self = [super init];
    
        if(self) {
            //Custom Initialization
            self.dirPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
            [self createDirectoryAtPath:self.dirPath];
    
        }
    
        return self;
    }
    
    
    /* Create Dir of Name ImageFilterDir */
    -(void)createImageFilterDirectory
    {
        self.dirPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
        [self createDirectoryAtPath:self.dirPath];
    }
    
    /* Creating Director if not exists */
    -(void)createDirectoryAtPath:(NSString *)folderPath
    {
        NSString *dPath = [folderPath stringByAppendingPathComponent:ImageFilterDir];
        NSError *error=nil;
    
        if(![[NSFileManager defaultManager] fileExistsAtPath:dPath])
        {
            [[NSFileManager defaultManager]  createDirectoryAtPath:dPath withIntermediateDirectories:NO attributes:nil error:&error];
            NSLog(@"Directory %@ Created..",dPath);
    
        }
        else
        {
            NSLog(@"Directory Exists Already..");
        }
    
    }
    
    
    /* Get File Path with File Name */
    -(NSString*)getFilteredImageFilePathWithFileName:(NSString *)fileName
    {
        NSString *documentDir = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
        NSString *filterImageDir = [documentDir stringByAppendingPathComponent:ImageFilterDir];
        NSString *filePath=nil;
    
        if([[NSFileManager defaultManager] fileExistsAtPath:filterImageDir])
        {
            filePath = [filterImageDir stringByAppendingPathComponent:fileName];
        }
        else
        {
            filePath=@"";
        }
    
        return filePath;
    }
    
    
    /* Save Image to Dir */
    -(void)saveImageToDocDir:(UIImage *)aImage withFileName:(NSString *)file
    {
        NSString *filePath = [self getFilteredImageFilePathWithFileName:file];
        NSData *imageData = UIImagePNGRepresentation(aImage);
        [imageData writeToFile:filePath atomically:YES];
    
        NSLog(@"Writing File => %@ .... ",file);
    }
    
    
    /* Get Image With File Name */
    -(UIImage*)getImageWithFileName:(NSString *)imageFileName
    {
        NSString *path = [self getFilteredImageFilePathWithFileName:imageFileName];
        NSData *fData = [NSData dataWithContentsOfFile:path];
    
        UIImage *image = [UIImage imageWithData:fData];
    
        return image;
    }
    
    
    /* Remove Image With File Name */
    -(BOOL)removeImageWithFileName:(NSString *)fName
    {
        NSFileManager *fileManager = [NSFileManager defaultManager];
        NSString *path = [self getFilteredImageFilePathWithFileName:fName];
        NSError *error=nil;
        if([fileManager fileExistsAtPath:path])
            return [fileManager removeItemAtPath:path error:&error];
        else
            return NO;
    }
    
    /* Delete All Dir Contents */
    -(void)deleteAllDirContents
    {
        NSFileManager *fileManager = [NSFileManager defaultManager];
        NSString *imgFilterDir = [self.dirPath stringByAppendingPathComponent:ImageFilterDir];
        NSError *error=nil;
        NSArray *arr = [fileManager contentsOfDirectoryAtPath:imgFilterDir error:&error];
    
        for (NSString *file in arr) {
            NSString *p = [self getFilteredImageFilePathWithFileName:file];
            if([fileManager fileExistsAtPath:p])
            {
                [fileManager removeItemAtPath:p error:&error];
            }
    
        }
    
    }
    
    /* Get All Dir Contents. Returns an Array of Filenames */
    -(NSArray*)getAllDirContents
    {
        NSFileManager *fileManager = [NSFileManager defaultManager];
        NSString *imgFilterDir = [self.dirPath stringByAppendingPathComponent:ImageFilterDir];
        NSError *error=nil;
        NSArray *arr = [fileManager contentsOfDirectoryAtPath:imgFilterDir error:&error];
    
        return arr;
    }
    
    
    /* Get All Dir Contents. Returns an Array of Image */
    -(NSArray*)getAllImageFromDir
    {
        NSFileManager *fileManager = [NSFileManager defaultManager];
        NSString *imgFilterDir = [self.dirPath stringByAppendingPathComponent:ImageFilterDir];
        NSError *error=nil;
        NSArray *arr = [fileManager contentsOfDirectoryAtPath:imgFilterDir error:&error];
    
        NSMutableArray *imgArr = [[NSMutableArray alloc]init];
    
        for (NSString *file in arr)
        {
            NSString *p = [self getFilteredImageFilePathWithFileName:file];
            if([fileManager fileExistsAtPath:p])
            {
                NSData *imgData = [NSData dataWithContentsOfFile:p];
                UIImage *image =[UIImage imageWithData:imgData];
                [imgArr addObject:image];
            }
    
        }
    
        return [imgArr autorelease];
    }
    
    
    /* Delete Dir */
    -(BOOL)deleteDir
    {
        [self deleteAllDirContents];
    
        NSString *f = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
        f=[f stringByAppendingPathComponent:ImageFilterDir];
        NSError *error=nil;
        if([[NSFileManager defaultManager] fileExistsAtPath:f])
        {
           return [[NSFileManager defaultManager] removeItemAtPath:f error:&error];
        }
        else
        {
            return NO;
        }
    
    }
    
    -(void)dealloc
    {
       // [fileName release];
        [dirPath release];
    
        [super dealloc];
    }
    
    @end
    

    Where I want to save image tomy document dir i use save method and for retrieving images i use getImageFrom….. method.

    I hope this will helps u more

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

Sidebar

Related Questions

I need to make an android App that when the user navigates to my
I need to make an ipad app which includes an image swiper but not
Just like in the normal iPhone calendar app, I need to make a table
i need some help here, i want to make my app can open all
I need to make photo app like photo app in ios. I need to
I need to make a QT app to run on the startup of an
I need to make rate option in my android app. I found this link
We need to make changes to an app that will cause all its URLS
I need to make simple CRUD web app (i'll get paid for it), but
I make an app that have to printing image. I need to print image

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.