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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:20:36+00:00 2026-06-03T07:20:36+00:00

Here is the code: CGRect myImageRect = CGRectMake(0, 0, 100, 100); UIImageView *myImage =

  • 0

Here is the code:

CGRect myImageRect = CGRectMake(0, 0, 100, 100);
UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect];
[myImage setImage:[UIImage imageNamed:@"Angry0.png"]];
[mainView addSubview:myImage];

Angry0.png is in my Resources folder. No image is display on simulator.

  • 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-03T07:20:38+00:00Added an answer on June 3, 2026 at 7:20 am

    Right… You need to initalize all your views…

    If I’m right your view hierarchy is this:

    -mainView
         -contentView
             -scrollView
                  -imageView
    

    So somewhere when you load mainView you also need to initalize all the child views…

    For example:

    ...
    //put this where you call mainView = [[UIView alloc] init...
    
    contentView = [[UIView alloc] init...
    //config the contentView
    
    scrollView = [[UIScrollView alloc] init...
    //config the scrollView
    
    ....
    

    Now, providing that you correctly set your views frames and initialized them they shouldn’t be null…

    You can check by calling:

    if (!scrollView) {
        NSLog(@"scrollView is null :(");
    }
    

    Then you should be able to call your existing code and all should be good

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

Sidebar

Related Questions

Here's the code: UIImageView * imgView = [[UIImageView alloc] initWithImage:image]; CGRect imgFrame = imgView.frame;
Here is my code UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 50, 300, 50)]; label.textAlignment =
Here is my code: - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) {
Here is my code - (void)embedYouTube:(NSString*)url frame:(CGRect)frame { UIWebView * videoView; NSString* embedHTML =
guys.i'm new to iphone. i encounter a problem.the uiimageview can't release...here is the code.
Here is my code , -(IBAction)casser{ oeuf1.contentMode = UIViewContentModeScaleAspectFit; [UIView animateWithDuration:1.0 animations:^{ CGRect newRect
I stumbled upon this piece of code today: CGRect rect = {{0,0},{w,h}}; Here, I
Here's my code: if (!_mail) { _mail = [[MFMailComposeViewController alloc] init]; _mail.mailComposeDelegate = self;
Here's the code I have but it's crashing ... any ideas? UIImage *tempImage =
Ok the error is showing up somewhere in this here code if($error==false) { $query

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.