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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:16:48+00:00 2026-05-22T18:16:48+00:00

Here is the thing: I have a view, which contains complicated content that need

  • 0

Here is the thing: I have a view, which contains complicated content that need be redraw after related data updated. I use multiple views to implement this, more likely that one large view contains several subviews, and every subview may also have several subviews. All these views override their own drawRect: method.

The question is that the complicated view takes large memory usage, and I want to know why drawRect: cause a large memory usage, so I can optimizing my view.

Is there anyone give me a hand? Thanks.

  • 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-22T18:16:49+00:00Added an answer on May 22, 2026 at 6:16 pm

    EDIT: I just noticed you didn’t actually say whether you’re talking about iOS or Mac OS X. I assumed iOS; if it’s OS X you’re on your own 😛 For future reference, it’s good practice to tag your question with the OS or framework you’re developing for.

    Basically, drawRect is the most memory-heavy way of dealing with views. iOS can’t optimise the subview system like it normally does because it doesn’t know what you’re doing, so there’s multiple levels of frame buffers that need to be redrawn before the frame reaches the screen. Consider whether entire views need to be redrawn, and seriously consider using the subview layout system (needsLayout: and friends) or Core Animation to do what you need.

    If you seriously need drawRect:, don’t give your view any subviews. Subviews do not play nice with drawRect. Either do all your drawing in the view you need, or use the layout subsystem or CA.

    Finally, last year’s WWDC sessions are good help here. Session 131 “Performance Optimisation on iOS” and session 104 “Designing apps with scroll views” both talk about UIView performance. Here’s the link to the sessions if you’ve lost it: WWDC session videos

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

Sidebar

Related Questions

I have a Tab that has a custom layout which contains a TextView .
I've got a view controller that contains a @property which is a custom subclass
Here is the problem. I have a stored procedure that transforms normalized data into
Kind-of a crazy question here... I have a view display that's set up as
I have a view that - among other things - contains a list of
I have an application which has a tabcontrol that contains two tabpages. I have
Here's the thing: I have two applications, written in C++ and running on two
Here is the thing. I currently have a tabBar controller, with several navigation controllers
Here is the thing. Right now I have this e-commerce web site where people
Having an issue here that I have tried everything I can think of but

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.