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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:36:03+00:00 2026-05-22T11:36:03+00:00

How may I modify, read in an image path from SQLite DB, & display

  • 0

How may I modify, read in an image path from SQLite DB, & display it via an UIImageView? In other words, this application will work in offline mode & i have the images at hand. How will i go about this then, tgt with sqlite? (retrieve images by storing their image path name @ sqlite)

Sample code I have for now:

- (void)viewDidLoad 
{
    [super viewDidLoad];

    appDelegate = (SQLAppDelegate *)[[UIApplication sharedApplication] delegate];   

    //start with index 0
    currentStepIndex = 0;

    Resolution *resolutionObj = [appDelegate.resolutionArray objectAtIndex:currentStepIndex];
    [resolutionDescription setText:resolutionObj.stepDescription];    

    //checking for null string
    //replicate of ifelse @goToNextStep & @goToLastStep (needed for initial load of image)
    if (resolutionObj.imageDescription != NULL) 
    {
        //if goes in here, then image description is not null        
        NSURL *imageURL = [NSURL URLWithString:resolutionObj.imageDescription];
        NSData *imageData = [NSData dataWithContentsOfURL:imageURL];
        [resolutionImage setImage:[UIImage imageWithData:imageData]];  
    }
    else
    {
        //if goes in here, then image description is NULL

        //show empty image
        [resolutionImage setImage:NULL];
    }
}
  • 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-22T11:36:04+00:00Added an answer on May 22, 2026 at 11:36 am

    You are missing a lot the way I see it. If your images are coming from a website then you should use a webView to display it. If you are planning to display images in UIImageView, you should first download them onto your device from the url that points to that image and save it in the sandbox. Then you store the path of this downloaded image in your sqlitedb. Now when you want to load this image you just access this image using the path that you have in your sqlitedb and render it. How do you think by just saving the imageName image013.png and not downloading the image itself will render the image for you in UIImageView. Just think where your UIImageView will go and find this image if it’s not already downloaded onto your device. For going and finding on the web directly, you need a UIWebView and not an UIImageView


    If you are packaging your images as resources with your app binary, you can load them as shown below:

    UIImage *img = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"myimagefile" ofType:@"png"]];
    [self.testView.imgView setImage:img];
    

    where myimagefile is the name of your file and ofType is the type of image. .png or .jpg or whatever.

    If you have anymore doubts. Please come back.

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

Sidebar

Related Questions

I am currently writing an application that read frames from camera, modify them, and
There may be more than one way to ask this question, so here's a
This may be a no-brainer for the WPF cognoscenti, but I'd like to know
This may seem like a daft question, but i was wondering about how to
This may seem like a programming 101 question and I had thought I knew
This may be simple one, but 5 mins of Googling didn't give me the
This may be a simple fix - but I'm trying to sum together all
This may be a matter of style, but there's a bit of a divide
Let's say I have the following Java interface that I may not modify: public
I read many articles about unsafe functions like strcpy, memcpy, etc. which may lead

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.