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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:59:39+00:00 2026-05-25T01:59:39+00:00

I have some code that displays a checkmark as the auxiliary view of a

  • 0

I have some code that displays a checkmark as the auxiliary view of a custom subclass UITableViewCell. Currently, I’m implementing this by having a method for my custom subclass that, when called, alloc’s a new UIImageView from a new UIImage, which in turn is loaded from a 4K .png file. There’s another custom method that removes the view and deallocates it when I want the checkmark to go away.

Obviously this is not the most efficient way to implement this, since every time I want to change state I have to alloc and init a new UIImage + associated objects. That being said, the code does work now, and I’m not sure whether it’s actually worth it to go and change it to more efficient implementation. Turning the checkbox on or off is a UI thing, so it’s never going to happen faster than a human can physically press the screen on their iOS device, and the image it’s loading is, like I said, a 4K .png. So, while I know I’m doing this in a really inefficient way, is it inefficient enough that it’s worth changing? (I’m not noticing any slowness that would affect the user experience as it is, although the app isn’t fully built yet).

  • 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-25T01:59:40+00:00Added an answer on May 25, 2026 at 1:59 am

    The prima facie observation is if the user experience isn’t affected then what you have is definitely efficient enough. Premature optimisation is always to be avoided.

    That being said, [UImage +imageNamed:] has an internal cache. Multiple calls to it will usually return the same UIImage object, exactly to help in cases like yours. If possible, use that method to fetch your UIImages.

    UIImage also lazy loads. It’s relative cheap to create one, linking it to a particular file, as the work of loading and decoding the file won’t be done until someone actually tries to draw the thing. That makes it hard to come up with an empirical idea of speed, since the work you’re ordering doesn’t occur until a hard-to-predict time in the future.

    So it’s hard to give an exact answer, and unlikely to be a problem but if you stick to +imageNamed then you can at least be secure that the OS is doing what it can to help you out.

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

Sidebar

Related Questions

I have some code that looks like this (I left out the parts that
I have some code that effectively does this : File file = new File(C:\\Program
I have some jquery code that displays and hides a div when a link
I have some code that continuously generates UIImage frames for animation. Currently I am
Some background: I have a site header and created some jQuery code that displays
I have some code that gets two Time Picker's content and displays them individually
I have some code that has the property display-inline . Due to this it
I'have written a simple code, that gets accelerometer&orientation meter and display some graphics based
i have some code that tries to list images based on their height. the
I have some code that creates a new event source: EventLog.CreateEventSource(Source, LogName); I know

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.