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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:22:44+00:00 2026-05-16T22:22:44+00:00

if i place a image.png file in my resource, iphone will be able to

  • 0

if i place a image.png file in my resource, iphone will be able to read it. if i place a image.png file in iphone document folder it doesn’t read?

i am sending the image over from my server, into the document folder. no problem with that.

i thought iphone will auto find the image file either in resource folder or document folder?

i did write any code for my app to locate the folder of my image, just called it by its file name, which is correct.

any ideas?

thks

// Get path to doc folder
NSArray *docpaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [docpaths objectAtIndex:0];
NSString *docpath = [documentsDirectory stringByAppendingPathComponent:@"Data.plist"];      
self.data = [NSArray arrayWithContentsOfFile:docpath];

done loading the plist from doc folder.

now i go to plist, get the file name and display for cell.

NSDictionary *dataItem = [data objectAtIndex:indexPath.row];
cell.icon = [UIImage imageNamed:[dataItem objectForKey:@"Icon"]];

how can i specifiy the image is in my document folder?

  • 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-16T22:22:45+00:00Added an answer on May 16, 2026 at 10:22 pm

    You can create an UIImage from a file by using imageWithContentsOfFile. However you can not read the file just specifying the name if it is in document folder. You need to get the path of your file. Check this answer to get an idea of how to get the file path of document folder.

    — edit
    If your plist contains the file names in document folder, then append the filenames from plist to document folder path to get the full path. Hope it helps.

    NSArray *docpaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [docpaths objectAtIndex:0];
    NSDictionary *dataItem = [data objectAtIndex:indexPath.row];
    NSString *imagePath = [documentsDirectory stringByAppendingPathComponent:[dataItem objectForKey:@"Icon"]];
    cell.icon = [UIImage imageWithContentsOfFile:imagePath];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to place the Default.png image into my iPhone App, yet can't
I am trying to use a background image... when I place the file.png in
I need to parse a value from an xml and place it to image's
I want to place links over a background image (set in CSS) and I
In the Apple documentation, it says... iPhone OS looks for a Default.png file, located
If I place (insert-image (create-image /tmp/test.png)) in a buffer, place the cursor after the
I'm attempting to use a custom built .PNG file of letters from the alphabet
Has anyone had problems inserting a PNG file into a word document, using a
I place a play.png image onto my view. When the view initially loads, the
I am trying to place a repeating gradient .png as a background-image for a

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.