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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:14:15+00:00 2026-05-15T22:14:15+00:00

Bear with me as I am new to obj-c but I have a UIScrollView

  • 0

Bear with me as I am new to obj-c but I have a UIScrollView and a segmented button that switches between 2 images that are presented in the scrollview. Each image is large and roughly 500Kb, but they are each causing allocations of 20+ MB and crashing my app.

     - (void)viewDidLoad {
 [bvpiscrollview setContentSize:CGSizeMake(768, 2484)];
 UIImage *loadBvImage = [UIImage imageNamed:@"bpi_1536x4965v2.png"];
 bvpiimg.image = loadBvImage;
 [loadBvImage release];
 [super viewDidLoad];
}
-(UIView *)viewForZoomingInScrollView:bvpiscrollview{
 return bvpiimg;
}

-(IBAction)pidonebutton{
 [self.view removeFromSuperview];
}

-(IBAction)segmentedControlIndexChanged{
 switch (self.segmentedControl.selectedSegmentIndex)
 {
  case 0:
   [bvpiscrollview setContentSize:CGSizeMake(768, 2484)];
   UIImage *loadBvImage = [UIImage imageNamed:@"bpi_1536x4965v2.png"];
   bvpiimg.image = loadBvImage;
   [loadBvImage release];
   break;
  case 1:
   [bvpiscrollview setContentSize:CGSizeMake(768, 2556)];
   UIImage *loadMpImage = [UIImage imageNamed:@"mpi_1536x5110v2.png"];
   bvpiimg.image = loadMpImage;
   [loadMpImage release];
  default:
   break;

 }
}
- (void)dealloc {
 [bvpiimg release];
 [bvpiscrollview release];
 [segmentedControl release];
    [super dealloc];
}
@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-05-15T22:14:15+00:00Added an answer on May 15, 2026 at 10:14 pm

    A 500k RGBA image would be about 350 pixels square. A 1536 x 5110 pixel RGBA image is about 31.4 MB. You seem to be confusing image size with file size.

    The largest size supported across all iOS devices is 1024 pixels on a side, although some support larger dimensions. Try cutting up your large images into smaller tiles before adding them to a view in the view hierarchy. You can cut the image up at runtime with a series of calls to CGImageCreateWithImageInRect. I usually choose 512 pixel or smaller tiles.

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

Sidebar

Related Questions

I'm new to Xcode, so bear with me: I have a table view that
New to python, bear with me. I have two text files, each has a
Very new to C so please bear with me. I have a function that
Please bear in mind that I'm totally new to Rails when answering this.My question
Bear with me, as I'm quite new to using regular expressions. I have regexp
I'm new to iPad development so please bear with me. I have an iPad
I am new to Ruby and Rails so bear with me please. I have
I am new to programming so bear with me. I have an XML document
I am new to programming so bear with me. I have many XML documents
I am new to iOS development so please bear with me. I have created

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.