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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:01:33+00:00 2026-05-25T21:01:33+00:00

In my .h file create 3 objects like below IBOutlet UIScrollView *scrollView; IBOutlet UITextView

  • 0

In my .h file create 3 objects like below

IBOutlet UIScrollView *scrollView;
IBOutlet UITextView *txtMessage;
IBOutlet UIWebView *webView;

In xib make Connection for all 3 objects
hierarchy in xib like

**View 
       ---UIScrollView
            ---UITextView
            ---UIWebView**

then I am printing retainCount in dealloc method

NSLog(@"scrollView retainCount:%d",[scrollView retainCount]);
    [scrollView release];scrollView=nil;
NSLog(@"txtMessage retainCount:%d",[txtMessage retainCount]);
    [txtMessage release];txtMessage=nil;
NSLog(@"webView retainCount:%d",[webView retainCount]);
    [webView release];webView=nil;

on console i am getting like below

scrollView retainCount:3
txtMessage retainCount:2
webView retainCount:2

I want to know why its happens like this ,and one more thing how can release this objects in dealloc method…

  • 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-25T21:01:33+00:00Added an answer on May 25, 2026 at 9:01 pm

    The answer is: you don’t release them. You didn’t alloc] init] then, they’re not your responsibility memory-wise.
    The only case where they’re somehow your responsibility, is when you retain them using a @property (retain) for the IBOutlets. In that case, you’ll release them in [dealloc]

    Answering to your comment in another answer about instruments and releasing the outlets that the xib creates: if you release them, then the view will be unload sometime and the responsible for releasing the elements in the .xib (which it wasn’t you) will release them again, and it will crash 😉 The reason why you go back to another view and the memory doesn’t decrease is because when a view disappears, it’s not unloaded, that only happens when either the view controller is deallocated, or when the application gets a memory warning.

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

Sidebar

Related Questions

How do I create a file-like object (same duck type as File) with the
I'm using the socket.makefile method to create a file-like object on a UDP socket
I use an asp (classic) utility file to create json objects from an SQL
I need to create file sharing and chatting system like Microsoft Groove under .NET
I want to make it like when I click a button, it will create
PdfFileReader reads the content from a pdf file to create an object. I am
I'm trying to create an object file which can be useable in any computer.
i need to create a object Image from import javax.microedition.lcdui.Image; using a file .png
I have created a file with printStream object as shown below. PrintStream outPutOffice =
using (var file_stream = File.Create(users.xml)) { var serializer = new XmlSerializer(typeof(PasswordManager)); serializer.Serialize(file_stream, this); file_stream.Close();

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.