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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:51:49+00:00 2026-05-23T16:51:49+00:00

I am implementing an iPhone app.for that,creating a common view controller throughout the application

  • 0

I am implementing an iPhone app.for that,creating a common view controller throughout the application and i am changing my views according to the requirements. for that i am writing the code like

addViewController = [[ProAddViewController alloc] initWithNibName:@"ProAddViewController" bundle:nil];
[addViewController.view setFrame:[[UIScreen mainScreen] applicationFrame]];
currentTabView = addViewController ;

and then when ever i want to add new view for the currentTabView, i am releasing the previous one then adding new view controller’s view to the currentTabView.finally i am releasing the currentTabView in dealloc().

i am getting a memory leak in the line shown below.

[addViewController.view setFrame:[[UIScreen mainScreen] applicationFrame]];

Can any one please help me out? Thanks in advance.

  • 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-23T16:51:50+00:00Added an answer on May 23, 2026 at 4:51 pm

    An easy way can be,
    if you are using the addViewController and currentTabView in a view controller, then declare them as a property, and use, self.addViewController and self.currentTabView when assigning new values.
    Then compiler will automatically handle releasing and deallocating. surely you have to release them in dealloc.

        self.addViewController = [[ProAddViewController alloc] initWithNibName:@"ProAddViewController" 
    bundle:nil];
        [addViewController.view setFrame:[[UIScreen mainScreen] applicationFrame]];
        self.currentTabView = addViewController ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm implementing an iPhone App that uses WebSockets (inside a hidden UIWebView), so I
I am trying to write an iPhone app that has both a UITabBar controller
I'm developing an iPhone/iPad app that supports dragging items between table views. Since all
I'm implementing an iPhone application that syncs data with an AppEngine backend. I'm using
I'm implementing a new iPhone app and am relatively new to Cocoa development overall.
I'm implementing an in app purchase for an iPhone app. All is good -
Ok...... I'm implementing a simple OpenGL ES application on the iPhone and I recently
So, in an iPhone app I am working on, I've decided that the best
I am writing an app that requires the user's current location (lastknownlocation won't be
I'm working on an iPhone application that should work in offline and online modes.

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.