Re: How are views supposed to reload after being nillified by memory warnings?
Re: How are views supposed to reload after being nillified by memory warnings?
- Subject: Re: How are views supposed to reload after being nillified by memory warnings?
- From: David Duncan <email@hidden>
- Date: Fri, 02 Mar 2012 10:17:43 -0800
On Mar 2, 2012, at 1:28 AM, G S wrote:
> It's the photo-picker (actually a view that presents the photo picker and
> then lets the user add a caption). It's presented with
> presentModalViewController and dismissed by the delegate, as is typical.
>
> The Apple photo picker often results in memory warnings (based on various
> forum posts I've seen). It's after the dismissal of the picker's owning
> controller that the white screen is revealed.
In the vast majority of cases where I've seen this behavior, it is because in your delegate handler for the UIImagePickerController, you assign the returned image directly to a UIImageView that you have in your view hierarchy. If you've recently gotten a memory warning, then this image view is either nil, or will be released very soon, and you will end up with a view that has no image.
If this does turn out to be the case, then lesson learned is "never store critical data in my views".
--
David Duncan
_______________________________________________
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