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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:29:00+00:00 2026-06-12T22:29:00+00:00

I’m having problem displaying UIImage in UIImageView. I looked all over stackoverflow for similar

  • 0

I’m having problem displaying UIImage in UIImageView. I looked all over stackoverflow for similar questions, but none of the fixes helped me.

  1. The image is indeed in my bundle
  2. File Inspector -> Target Membership is checked for the image
  3. IBOutlet is connected (I have tried both using IBOutlet and doing it programmatically)
  4. Both png nor jpg works

Here’s the code for using Interface Builder –

//@property and @synthesize set for IBOutlet UIImageView *imageView
    - (void)viewDidLoad
    {
        [super viewDidLoad];
        NSAssert(self.imageView, @"self.imageView is nil. Check your IBOutlet connection");
        UIImage *image = [UIImage imageNamed:@"banner.jpg"];
        NSAssert(image, @"image is nil");
        self.imageView.image = image;      
    }

This code will terminate with NSAssert, printing in the console that ‘image is nil’.

I also tried selecting the Image directly from the attributes inspector:
enter image description here

However it still doesn’t show the image (still terminates with NSAssert – ‘image is nil’).

Any help or suggestions will be greatly appreciated.

Thanks

  • 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-12T22:29:01+00:00Added an answer on June 12, 2026 at 10:29 pm

    See if you can get see the file in your code – use

    path = [[NSBundle main bundle] pathForResource:@"banner" ofType:@"jpg"];
    assert(path); 
    assert([[NSFileManager defaultManager] fileExists:path])
    

    I just typed this in but you get the idea – get the path using the first, make sure you got it, then ask the file manager to see if it exists. If it does you can read the file into a NSData object, then log the size, then see if you can create the image using imageWithData – if that fails then iOS may not be able to decompress it.

    I often take images created in PhotoShop or elsewhere, load them in Preview, then save them before adding them to my projects. In general, if an Apple technology saves the image in whatever format you want (png, jpg, etc), then its likely that iOS can open it too.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
This could be a duplicate question, but I have no idea what search terms
I've tracked down a weird MySQL problem to the two different ways I was
I have a text area in my form which accepts all possible characters from
I know there's a lot of other questions out there that deal with this

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.