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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:05:49+00:00 2026-05-16T16:05:49+00:00

EVERYTHING WRITTEN HERE ACTUALLY WORKS RIGHT EXEPT FOR [UIImage imageNamed:] METHOD USAGE Implementation I

  • 0

EVERYTHING WRITTEN HERE ACTUALLY WORKS RIGHT

EXEPT FOR [UIImage imageNamed:] METHOD USAGE


Implementation

I am using model in witch you have a custom UITableViewCell with one custom UIView set up as Cell’s backgroundView.

Custom UIView contains two Cell-sized images (320×80 px), one of which is 100% transparent to half of the view. All elements are set to be Opaque and have 1.0 Alpha property.

I don’t reuse Cells because I failed to make them loading different images. Cell’s reused one-by-one up to 9 cells overall. So I have 9 reusable Cells in memory.

Cell initWithStyle:reuseIdentifier method part:

    CGRect viewFrame = CGRectMake(0.0f, 0.0f, 320.0f, 80.0f);
    customCellView = [[CustomCellView alloc] initWithFrame:viewFrame];
    customCellView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    [self setBackgroundView:customCellView];

CustomCellView’s initialization method:

- (id)initWithFrame:(CGRect)frame {
    if ((self = [super initWithFrame:frame])) {
        self.opaque = YES;
        self.backgroundColor = [UIColor UICustomColor];
    }
    return self;
}

Images are being pre-loaded to NSMutableArray as UIImage objects from PNG files with UIImage’s imageNamed: method.

They are being set in UITableViewDelegate’s method tableView:cellForRowAtIndexPath: and passed through UITableViewCell with custom method to UIView.

And then drawn in UIView’s drawRect: overridden method:

- (void)drawRect:(CGRect)rect {
    CGRect contentRect = self.bounds; 
    if (!self.editing) {
        CGFloat boundsX = contentRect.origin.x;
        CGFloat boundsY = contentRect.origin.y;
        CGPoint point;
        point = CGPointMake(boundsX, boundsY);
        if (firstImage)  { [firstImage  drawInRect:contentRect blendMode:kCGBlendModeNormal alpha:1.0f]; }
        if (secondImage) { [secondImage drawInRect:contentRect blendMode:kCGBlendModeNormal alpha:1.0f]; }
    }
}

As you see images are being drawn with drawInRect:blendMode:alpha: method.

Problem

Well, UITableView can’t be scrolled at all, it’s being struck on every cell, it’s chunky and creepy.

Thoughts

Well digging sample code, stackoverflow and forums gave me thought to use OpenGL ES to pre-render images, but, really, is it that hard to make a smooth scrolling?

  • 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-16T16:05:50+00:00Added an answer on May 16, 2026 at 4:05 pm

    What’s wrong with just using UIImageViews? Are they not fast enough? (They should be if you’re preloading the UIImages).

    One thing to note is that [UIImage imageNamed:] won’t explicitly load the image data into memory. It’ll give you a reference which is backed by the data on disk. You can get around this by making a call to [yourImage CGImage].

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

Sidebar

Related Questions

I am using uploadify jQuery plugin form here . Everything works fine on my
i have written an application that needs to process outgoing calls. Everything works fine,
[ edit : I've written a blogpost that explains everything in detail: look here
I did absolutely everything what is written in here: http://www.leonardaustin.com/technical/how-to-install-memcached-on-xampp-on-windows-7 I see now in
I did everything as it is written in the book of Vaswani V. -
I have written a small program just like hello the world , everything was
I am trying to insert page numbers for a document written with LibreOffice. Everything
Everything is working fine until I call the saveFile method (shown below) to write
I have here a slight problem. We have written a big spring based application
I have Java webserver (no standard software ... self written) . Everything seems to

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.