Re: UIViewControllers being reloaded on didReceiveMemoryWarning... ?
Re: UIViewControllers being reloaded on didReceiveMemoryWarning... ?
- Subject: Re: UIViewControllers being reloaded on didReceiveMemoryWarning... ?
- From: Chris Parker <email@hidden>
- Date: Wed, 13 Apr 2011 16:42:40 -0700
On 13 Apr 2011, at 4:14 PM, Martin Linklater wrote:
> Hi - I'm working on latest iOS and when testing my code on an iPhone3G I sometimes get this log output:
>
> 2011-04-14 00:03:08.920 CRDev[18309:307] InGameViewController - viewDidUnload
> 2011-04-14 00:03:09.223 CRDev[18309:307] InGameViewController - viewDidLoad
> 2011-04-14 00:03:09.640 CRDev[18309:307] InGameViewController implementation of -viewDidUnload caused the view to be reloaded. This will adversely impact system performance.
> 2011-04-14 00:03:09.732 CRDev[18309:307] InGameViewController - didReceiveMemoryWarning
> 2011-04-14 00:03:09.745 CRDev[18309:307] InGameViewController - viewDidUnload
> 2011-04-14 00:03:09.781 CRDev[18309:307] InGameViewController - viewDidLoad
> 2011-04-14 00:03:09.934 CRDev[18309:307] InGameViewController implementation of -viewDidUnload caused the view to be reloaded. This will adversely impact system performance.
>
>
> Can anyone tell me what's causing this ? It's screwing up some of the child views and causing some subtle bugs...
The log is trying to help you out; -viewDidUnload is called when the view controller has discarded its view. The log is telling you that an implementation of -viewDidUnload is causing the view to be loaded again.
This can be caused by doing anything which accesses the -view property on the view controller inside the -viewDidUnload implementation.
Look around in InGameViewController's implementation of -viewDidUnload and see if you're doing anything that involves '[self view]' (or 'self.view' for you dot-syntax people :) ).
.chris
--
Chris Parker
iOS Frameworks (UIKit)
Apple Inc.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden