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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:23:46+00:00 2026-06-03T05:23:46+00:00

On my quest to reduce memory usage, another question. I see that UIImage and

  • 0

On my quest to reduce memory usage, another question.
I see that UIImage and CGImage might be candidates for high memory usage in my app.
Wherever I use a UIImage, I try to wrap it in a using block to have it Dispose()‘d as soon as possible.

However, often the UIImage ends up in a UIImageView.Image property.
If I remove the UIIImageView from its Superview, am I supposed to Dispose() the Image property before and set it to null or is this wasted typing?

  • 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-03T05:23:47+00:00Added an answer on June 3, 2026 at 5:23 am

    am I supposed to Dispose() the Image property

    Quick answer: No.

    Long answer:

    The UIImageView.Image property, image selector, is retained. Even if you dispose it (from the managed side) the native retainCount (Objective-C is reference counted) of the UIImage will still be higher than 0 and the (native side of the) UIImage won’t be freed.

    When you dispose the UIImageView it will release the UIImage it use (Apple’s Objective-C code) and, if the retainCount reach 0, it will be natively freed.

    If there’s a large delay between when you stop needing the UIImage and the time you dispose of the UIImageView then you might want to set UIImageView.Image to null. That will release (in the ObjC way, i.e. drop its retainCount by one) the UIImage and, if it’s not used elsewhere, it will be (natively) freed.

    Note that, if the UIImageView is not disposed, then setting its Image property to another UIImage will have the same result (the old one’s will be released).

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

Sidebar

Related Questions

Quest I am looking to fetch rows that have accented characters. The encoding for
In my quest for my first iPhone app I have posted about the correct
I've noticed while on my quest to lean functional programming that there are cases
I'm on a quest to reduce my very bloated home page application in development.
Update: This question was inspired by my larger quest for mapping ontologically the whole
I'm on a quest to see if I can figure out how to access
A bit of a silly question for more advanced programmers, but In my quest
In my quest to develop a pretty data-driven silverlight app, I seem to continually
In the quest for more opinions I rewrite the question (I´m learning how to
In my quest to learn ActionScript 3.0 I have stumbled across another situation where

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.