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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:57:59+00:00 2026-05-30T08:57:59+00:00

sorry to asking basic question.In my viewcontroller memory is going up when i rotate

  • 0

sorry to asking basic question.In my viewcontroller memory is going up when i rotate my device to prevent that I modified all my IBOutlets with @property and @synthesize even that also not working still my allocation are going peak i dont know what mistake i did in didrotate method I provided my code below.Here i am just modifying my images and frames for my IBOutlets.Is there any wrong in the below provided code?

-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{
            if(UIInterfaceOrientationIsPortrait(self.interfaceOrientation)){
                for(UIImageView *thumbImage in [tableSupportView subviews]){
                        UIImage *tempImage=[bookListDataSource bookAtIndex:thumbnilIndex].titleImage;
                        CGFloat thumbnilHeight=95*((float) tempImage.size.height/tempImage.size.width);
                        thumbImage.frame=CGRectMake(thumbnilIndex*125, (205-thumbnilHeight)/2, 95, thumbnilHeight);
                        thumbnilIndex++;
                }
                self.myoutlets.frame=cgrect(frames according to criteria);
                NSString *detailImagePath=[[NSBundle mainBundle] pathForResource:@"details_bg_nb" ofType:@"png"];
                UIImage *detailImage=[[UIImage alloc] initWithContentsOfFile:detailImagePath];
                UIColor *bookDetailViewColor=[[UIColor alloc] initWithPatternImage:detailImage];
                self.bookDetailView.backgroundColor=bookDetailViewColor;
                [bookDetailViewColor release];
                [detailImage release];
                NSString *listBGImagePath=[[NSBundle mainBundle] pathForResource:@"list_bg_nb" ofType:@"png"];
                UIImage *listBGImage=[[UIImage alloc] initWithContentsOfFile:listBGImagePath];
                UIColor *listHeaderContainerViewColor=[[UIColor alloc] initWithPatternImage:listBGImage];
                self.listHeaderContainerView.backgroundColor=listHeaderContainerViewColor;
                [listHeaderContainerViewColor release];
                [listBGImagePath release];

                NSString *listBandPath=[[NSBundle mainBundle] pathForResource:@"listband_potrait" ofType:@"png"];
                UIImage *listBand=[[UIImage alloc] initWithContentsOfFile:listBandPath];
                self.categoryBrandingImageView.image=listBand;
                [listBand release];
            }else {
                NSUInteger thumbnilIndex=0;
                NSUInteger numberOfBooks=[bookListDataSource numberOfBooks];
                for(UIImageView *thumbImage in [tableSupportView subviews]){
                        UIImage *tempImage=[bookListDataSource bookAtIndex:thumbnilIndex].titleImage;
                        CGFloat thumbnilHeight=85*((float) tempImage.size.height/tempImage.size.width);
                        thumbImage.frame=CGRectMake(thumbnilIndex*115, (CGRectGetHeight(tableSupportView.frame)-thumbnilHeight)/2.0, 85, thumbnilHeight);
                        thumbnilIndex++;
                    }
                }
            self.myoutlets.frame=cgrectmake(my custom frame);
                NSString *detailImagePath=[[NSBundle mainBundle] pathForResource:@"landscape_details_bg_nb" ofType:@"png"];
                UIImage *detailImage=[[UIImage alloc] initWithContentsOfFile:detailImagePath];
                UIColor *bookDetailViewColor=[[UIColor alloc] initWithPatternImage:detailImage];
                self.bookDetailView.backgroundColor=bookDetailViewColor;
                [bookDetailViewColor release];
                [detailImage release];

                NSString *listBGImagePath=[[NSBundle mainBundle] pathForResource:@"landscape_list_bg_nb" ofType:@"png"];
                UIImage *listBGImage=[[UIImage alloc] initWithContentsOfFile:listBGImagePath];
                UIColor *listHeaderContainerViewColor=[[UIColor alloc] initWithPatternImage:listBGImage];
                self.listHeaderContainerView.backgroundColor=listHeaderContainerViewColor;
                [listHeaderContainerViewColor release];
                [listBGImagePath release];

                NSString *listBandPath=[[NSBundle mainBundle] pathForResource:@"listband_landscape" ofType:@"png"];
                UIImage *listBand=[[UIImage alloc] initWithContentsOfFile:listBandPath];
                self.categoryBrandingImageView.image=listBand;
                [listBand release];
            }
            self.bookInformation.backgroundColor=[UIColor clearColor];
            self.bookDescrption.backgroundColor=[UIColor clearColor];
        }
    }

if any leaks is there please provide me the solution.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-30T08:58:01+00:00Added an answer on May 30, 2026 at 8:58 am

    In this part of code you have a mistake –

    NSString *listBGImagePath=[[NSBundle mainBundle] pathForResource:@"landscape_list_bg_nb" ofType:@"png"];
    UIImage *listBGImage=[[UIImage alloc] initWithContentsOfFile:listBGImagePath];
    UIColor *listHeaderContainerViewColor=[[UIColor alloc] initWithPatternImage:listBGImage];
    self.listHeaderContainerView.backgroundColor=listHeaderContainerViewColor;
    [listHeaderContainerViewColor release];
    [listBGImagePath release];
    

    You have to release listBGImage instead of listBGImagePath

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

Sidebar

Related Questions

I might be asking a very basic question and I am sorry for that.
Sorry for asking a basic question like this but I've been reading on this
Sorry for asking this question, but I searched all Java-related questions, but I got
I am learning Haskell. I'm sorry for asking a very basic question but I
Sorry for asking a basic question, I am learning C and I got confused
Guys, sorry for asking basic question, i have a problem here where I have
sorry a basic question and I have resorted to asking as I can't find
Sorry for asking probably a basic question, but I'm having a blackout. If I
First of all I'm really sorry for asking such a basic thing, I know
Sorry for the basic question - I'm a .NET developer and don't have much

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.