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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:45:40+00:00 2026-05-30T22:45:40+00:00

iPhone n00b here, although I do have an app in the store. I have

  • 0

iPhone n00b here, although I do have an app in the store.

I have two simple ViewControllers, taken directly from the Utility Application template in xCode. I have two UIImageViews, one on each ViewController in a storyboard. I have the outlets hooked up correctly (as far as I know) because I can set the image of the first ViewController fine with

[self.imageView setImage:@"test.png"]

When I try to do essentially the same thing in my FlipsideViewController, nothing happens.

- (void)selectImage:(UIImage *)img
{
    NSLog(@"%@", img);
    self.editImageView.image = img;
    NSLog(@"%@", self.editImageView.image);
}

This code, gives the correct result after logging the first NSLog statement, but the second line does not have the desired effect, and the third line yields (null).

EDIT: the coed is updated to reflect the fact that I want to display “img” rather than another image initialized using imageNamed, that was simply a test.

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

    If you’re passing a UIImage to your method, why are you then setting the imageView via the imageNamed: function?

    If you’re passing the correct UIImage then you should just do the following.

    - (void)selectImage:(UIImage *)img
    {
        NSLog(@"%@", img); // This is the UIImage being passed.
        [self.editImageView setImage:img];
        NSLog(@"%@", self.editImageView.image);
    }
    

    From what I can see that is all that is needed. If this is wrong, please update your question so I can answer accordingly.

    Edited due to comments

    So, from the comments I have gathered what the issue is.

    You’re saying that in -(void)viewDidLoad you can set the image, that is easy, with the [UIImage imageNamed:] method. That’s fine, but you want to do it in a separate method which is causing the issue.

    What I’d suggest is doing the following, for testing sakes.

     - (void)viewDidLoad
     {
          [super viewDidLoad];
          // Do any additional setup after loading the view from its nib.
    
          UIImage *imageYouWantToPass = [UIImage imageNamed:@"test.png"];
          [self selectImage:imageYouWantToPass];
    
     }
    

    Make sure that the method selectImage: is added to your .h file so that you don’t get any warnings. I think this is what the answer is, but if this still doesn’t resolve your question please provide more information.

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

Sidebar

Related Questions

I've been playing around with upgrading from an iPhone app to a Universal application,
on iPhone App Store I see two categories of apps - not free w/
iPhone application, which has two buttons -right side- of Navigation Bar title. I want
in iphone i have requirement of store image in cache . but how i
iPhone: How do you suspend the screen saver-fader to have an app run for
When iPhone application go to applicationWillResignActive mode, I need to download the data from
First post and first iPhone app in the making here, so please excuse the
iPhone Apps built for the simulator are stored here: /Users/<username>/Library/Application Support/iPhone Simulator/User/Applications Is it
Have noticed issue while testing iphone app that if one quickly opens/dismisses a modal
Some iPhone applications, such as Pandora seem to directly manipulate the hardware volume and

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.