I think the best way to look into this is that your App should not need to
handle memory warnings.
If it receives one, it might be too late to do anything.

The way to handle it is the same of keeping your memory usage down.
Explicitly dispose
all your large objects as soon as you're done with them. Pay
special attention to webviews,
uicontrollers and images.



On Mon, Aug 27, 2012 at 7:24 AM, devnl <[email protected]> wrote:

> I'm fairly new at MonoTouch development and am currently looking into
> memory
> management. I have some AVFoundation code based on the CaptureManager
> example from Xamarin which throws the DidReceiveMemoryWarning message.
> Therefore I started reading up on the matter. I have figured out that
> implementing ViewDidUnload and DidReceiveMemoryWarning is a common
> practice,
> but am unsure as to what both method implementations usually look like.
>
> Currently I'm setting all my member variables to null in ViewDidUnload and
> DidReceiveMemoryWarning is basically doing nothing. I'm using a
> NavigationController to handle the navigation and have read that clearing
> all the views that aren't shown from memory is also recommended but I
> haven't really figured out how. Is there any best practice that people use
> to implementing these two methods?
>
> Another thing I'm wondering is the following. If I have a ViewController
> which I push onto the NavigationController and push a new instance of the
> same ViewController again later in the application flow, do both instances
> stay in memory?
>
> Thanks in advance,
>
> devnl
>
>
>
> --
> View this message in context:
> http://monotouch.2284126.n4.nabble.com/What-s-best-practice-in-implementing-DidReceiveMemoryWarning-tp4656729.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch
>
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to