On Mar 3, 2012, at 8:57 AM, Matt Neuburg wrote:

> On Fri, 02 Mar 2012 10:17:43 -0800, David Duncan <david.dun...@apple.com> 
> said:
>> On Mar 2, 2012, at 1:28 AM, G S wrote:
>> 
>> 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.
> 
> So let's say I have a view controller. And let's say that its view 
> (self.view) contains a UIImageView in its hierarchy (self.view.imageview). 
> You are saying that the runtime might summarily rip the UIImageView out of 
> the interface, so that self.view is *not* nil but self.view.imageview *is* 
> nil???


No. But if you've presented a modal view controller, your entire view hierarchy 
(self.view) has been ripped out of the window, and if a memory warning arrives, 
then self.view will be set to nil. What happens next depends on if you 
implemented -viewDidUnload properly or if your view references are strong or 
weak.

If they are strong and you did not implement -viewDidUnload properly, then your 
view reference will be non-nil. On the next load however, that reference will 
be replaced by a newly created view. If they are weak, or you implemented 
-viewDidUnload properly, then the view reference will be nil, and the usual 
message to nil semantics will take over.
--
David Duncan


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to