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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:56:47+00:00 2026-06-09T00:56:47+00:00

I am trying to set the bigImage, cadImage, and number in my class IDViewController.

  • 0

I am trying to set the bigImage, cadImage, and number in my class IDViewController. But these are never set when I use the code below. Obviously these properties are synthesized properly, and are on a scene on my storyboard. Am I missing something here?

ViewController.m

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([[segue identifier] isEqualToString:@"leftMainSegue"])
    {
        IDViewController *vc = [segue destinationViewController];

        [vc.bigImage setImage:[UIImage imageNamed:@"1.png"]];
        [vc.number setText:@"01"];

    }
}

IDViewController.h

@interface IDViewController : UIViewController
{
    UIImageView *bigImage;
    UIImageView *cadImage;
    UILabel *number;

}
@property (nonatomic) UIImageView *bigImage;
@property (nonatomic) UIImageView *cadImage;
@property (nonatomic) UILabel *number;

@end
  • 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-09T00:56:50+00:00Added an answer on June 9, 2026 at 12:56 am

    Even though IDViewController is initialized by the time prepareForSegue: is called, it probably hasn’t loaded its view and therefore not the sub-views that you’re trying to update.

    You would be better to set the image and text into properties directly owned by the controller and then set them into the views in viewDidLoad:.

    Something like…. (Warning! Not checked by compiler!)

    In IDViewController.h:

    @property (nonatomic, strong) UIImage *inputImage;
    @property (nonatomic, strong) NSString *inputString;
    

    In IDViewController.m:

    @synthesize inputImage = _inputImage;
    @synthesize inputString = _inputString;
    ...
    - (void)viewDidLoad {
    ...
        self.bigImage.image = self.inputImage;
        self.number.text = self.inputString;
    ...
    }
    

    In ViewController.m:

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    ...
        vc.inputImage = [UIImage imageNamed:@"1.png"];
        vc.inputString = @"01";
    ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to set a value in a method as shown below but when
I am trying set up a simple dropdown list but I dont seem to
Im trying to set my tabs as a scrollbar. I have 6 tabs but
Im trying to set Language for System.Windows.Control.RichTextBox as es-PE, but I found some issues,
I'm trying set an text AND X (Close) label in header of rich:panel, but
Trying to set up a project but fail at Autowiring objects through Spring. package
Trying to set up a cassandra cluster, but it tells me that I have
been trying to set up a webserver with uk2.net all day but i keep
When trying to set a fixed window size why doesn't the following code work:
Trying to set up the Login control as a User control, but none of

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.