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

  • Home
  • SEARCH
  • 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 4017650
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:53:14+00:00 2026-05-20T09:53:14+00:00

I have a view controller who’s views are loaded from a nib file. The

  • 0

I have a view controller who’s views are loaded from a nib file. The nib file contains the main view, which has a scroll view as its subview. Inside view controller’s viewDidLoad method, the retain count of the scroll view is 2 (1 for when it was created, and 1 because I retain it). When the view controller’s dealloc method is being called, I release the scroll view, but its retain count only decreases to 1, which makes sense since it was 2 at the beginning.

Based on the above scenario, my question is: does the scroll view get fully released after the dealloc method returns, because it is then that the main view is released, forcing all of its subviews (such as the scroll view), to be removed/released? Or, does this release happen at a different point in time?

Thanks!

EDIT: If after I release the scroll view, I set it to nil (while the retain count is still 1), will that scroll view ever get fully released?

  • 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-20T09:53:14+00:00Added an answer on May 20, 2026 at 9:53 am

    It is retained by the superview it is located in, when that superview goes away it will get another release (and so dealloc’d if the retain count goes to zero). If you’re curious you could subclass the UIScrollView and put a NSLog or breakpoint in the dealloc function to be sure. Or, run with the Leaks Instrument and see if it’s showing up as a leak.

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

Sidebar

Related Questions

i have view controller which contains a button which show the image library ,if
I have a view controller based app that contains several views that I display/hide
I have a View controller displaying some information (not table views). I have an
I have two view controller classes in my application delegate. I can change from
I have a view controller class that has to implement several protocols. Too keep
I have a controller view who is using thoses 2 functions: [appDelegate getFichesInfo:[[self.fichesCategory idModuleFiche]
I have a button in a Nib based view which does not behave like
I have a simple application, in which there is a view controller which is
I have view controller, into the view i have put a table view, and
I have a view controller with a scrollview with lots of text boxes, when

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.