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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:55:30+00:00 2026-05-26T19:55:30+00:00

I have 7 ViewControllers in an app, one of which loads a local PDF

  • 0

I have 7 ViewControllers in an app, one of which loads a local PDF into a UIWebView. The initial load has no problems, but if I leave that ViewController and come back to it, upon the second or third time I get “Received memory warning” while debugging on an iPad (I haven’t experienced this problem in the simulator, but that doesn’t mean I won’t get it eventually). I have made sure the case/caps are consistent with the file and my code, and I get no build errors or warnings. I have been told mixed stuff about xcode4 needing @property/@synthesize/dealloc, so I’ve tried both with and without that, and the results haven’t changed.

Here is my .h file

#import <UIKit/UIKit.h>

@interface Article6 : UIViewController {
    IBOutlet UIWebView *webview;
}

@end

and here is my .m file

#import "Article6.h"

@implementation Article6


- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView
{
}
*/


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    [super viewDidLoad];

    NSString *path = [[NSBundle mainBundle] pathForResource:@"mfa" ofType:@"pdf" inDirectory:NO];
    NSLog(@"path: %@",path);
    NSURL *url = [NSURL fileURLWithPath:path];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [webview loadRequest:request];

}


- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    //return (interfaceOrientation == UIInterfaceOrientationPortrait);
    return YES;
}

@end

I am using the swipe gesture from the storyboard, and also a regular button, and this error occurs with both segues. And yes, all the outlets are connected.

  • 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-26T19:55:30+00:00Added an answer on May 26, 2026 at 7:55 pm

    Check out your own comments in your viewDidUnload method. This is where you need to release, it appears that you are creating a new view everytime you load a view. So release it when you unload. I’m guessing deAlloc doesn’t get called every time you close a webview.

    To make sure I’d simply just use some logs to see your retain count and make sure you are keeping it down. Good luck!

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

Sidebar

Related Questions

I am developing an app which has several viewControllers. The first one is MainMenu
I have an app that has a UINavigationController that pushes a UITabBarController into view.
Follow up question on this one Say my app has several ViewControllers , let's
I have 10 viewControllers in my app. I have pushed all these viewControllers using
In my navigation stack, I have 2 viewcontrollers, which were pushed to the navigation
I have an app consisting of a TabBar with a few TabBarControllers. One Controller
In my current Ipad app, I have a split screen view in which the
I have an app which caches large images so that user do not wait
I'm writing an iPhone app (which will be my first ios app) that has
I have a three view tab bar app the second view of which I

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.