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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:04:06+00:00 2026-05-25T15:04:06+00:00

How can I make an UIImageView load an image, but the URL is on

  • 0

How can I make an UIImageView load an image, but the URL is on a UILabel?

More explanation: I have a UILabel containing an image web address, so I want this address to load an image on the UIImageView. I suppose it involves some encoding but I have no idea how to do this. Please help!

  • 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-25T15:04:07+00:00Added an answer on May 25, 2026 at 3:04 pm
    UIImage *myImage = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:yourlabel.text]]];
    

    Add the above image on your UIImageView:

    UIImageView *img = [[UIImageView alloc] initWithImage:myImage];
    

    EDIT: Go here and read up on the “Categories” section. The sample method there checks if your string is a URL with a http:// prefix to it. Use that and if it returns NO, just add the string “http://” as a prefix to yourlabel.text and then pass it above instead of yourlabel.text

    And yes as the link says, its just basic URL detection that just verifies if the string has been prefixed with http://

    Sample code: A simple window based app

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        // Override point for customization after application launch.
    
        UILabel *label = [[UILabel alloc] init];
        label.text = @"http://www.arthistoryarchive.com/arthistory/cubism/images/PabloPicasso-Weeping-Woman-with-Handkerchief-1937.jpg";
        UIImage *myImage = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:label.text]]];
        UIImageView *img = [[UIImageView alloc] initWithImage:myImage];
        img.frame = CGRectMake(0, 0, 768, 1024);
        [self.window addSubview:img];
        [self.window makeKeyAndVisible];
        return YES;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to have an UIImageView that flickers. I thougt I can make
I can make a single row IKImageBrowserView by setting the [imageBrowser setContentResizingMask:NSViewWidthSizable]; but in
Can someone tell me how I can make the following output? I have a
How can I make it so the image goes away when it is touched.
developing iphone app, I have used a UIImageview and i have set an image
I have a game where you have specks and connectors. I make a UIImageView
I have a UIImageView that is an image of the star. The problem is
I'm trying to make a UIImageView with a .png load up in the location
I have an UIImageView (100x100px) and when a user taps on the image I
I got an Icon of UIImageView named IconView. I want to make sure when

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.