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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:12:11+00:00 2026-06-14T07:12:11+00:00

I have a UITableView that I’m trying to populate with photos from a server

  • 0

I have a UITableView that I’m trying to populate with photos from a server along other data (e.g. photo comments). The table cells on the UITableView has a UIImageView that is set with setImageWithURL:placeHolderImage:. The problem is that only the placeholder image is being shown.

I have subclassed AFHTTPClient and I’m using Basic Authentication with my server. So, I am doing something like this:

[self setAuthorizationHeaderWithUsername:@"user" password:@"pass"];

When I do a GET request against the server, I’m getting the JSON that contains the data and the path of the images. Within the tableView:cellForRowAtIndexPath: method, I’m trying to set the UIImageView with setImageWithURL:placeHolderImage:, but each of the requests to download the images is returning a 401 Authorization Required.

I’m assuming that each call to the image URLs does not include the Basic Authentication info that I have in the subclassed AFHTTPClient. If that is indeed the case, is there a way to have the setImageWithURL:placeHolderImage: use the subclassed AFHTTPClient that contains the Basic Authentication info? Or is there some other approach I can take to respect this Basic Auth in each call to download the images?

  • 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-14T07:12:12+00:00Added an answer on June 14, 2026 at 7:12 am

    While the setImageWithURL:placeHolderImage: is a super convenient method you may have to use some work arounds to get this to work as you want it too. Since image downloads don’t usually require authentication this isn’t too surprising. You could alter the code of UIImageView+AFNetworking.m. This way you could use the setAuthorizationHeaderWithUsername method to authorize yourself.

    Alternatively, you could utilize the underlying methods that setImageWithURL:placeHolderImage: uses here and create your own similar class using AFImageRequestOperation in which you could set an appropriate authorization header. If you choose this be sure to implement similar cache methods to make everything as efficient as possible.

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

Sidebar

Related Questions

I have a UITableView that gets information from a server and publishes the data
I have a UITableView that lists comments from various users. I save all of
I have a UITableView that collects data from a database. What I would like
I have a UITableView that has photos, i get these photos from URLs and
I have a UITableview cell that gets a tally from a core data database.
I have an UITableView that derives its data from an NSArray . In the
I have a UITableView that I populate with data that i download over the
I have a UITableView that uses JSON to to get new data from the
I have a UITableView that is being populated by core data. Now, when I
I have a UITableView that displays various nsstrings from a custom object called 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.