Thanks Robert.

What I am doing right now is testing how to properly release the view of
one UIViewController that is being referenced by another UIViewController.
In the case here I am doing the following:

1) UIViewController A is my master view controller; B is my child
controller.
2) A creates an instance of B and stores the reference.
3) A adds B's view as a subview.

Everything is right with the world. I see B's view correctly shown in A's
view.

4) A removes B's view. B's view is now not referenced anywhere in my code.
5) I invoke DidReceiveMemoryWarning (via Simulate or manual call).

The test code from my previous post is run as described. I understand that
the delegate { } call will cause by view controller to be referenced; this
is desired. Even though my VC is referenced I expect that the view, which
my WeakReference is targeting, should be removed at some point. I want to
keep my VC and its specific settings in memory for later use but I want the
View to be unloaded. The next time I use this VC I would expect that
ViewDidLoad() would be called when I attempt to add it's view.

This is not the case. My WeakReference reports that the view stays alive
even though there are no active references and the memory warning was
registered.

Does this make sense?



On Tue, Nov 1, 2011 at 1:51 PM, Robert Jordan [via MonoTouch] <
[email protected]> wrote:

> On 01.11.2011 20:50, shawnlehner wrote:
> > I am actually using a custom navigation controller which inherits from
> > UIViewController. The navigation structure inside my application is
> unique
> > and didn't fit well into the normal nav controller. Should I subclass
> from
> > this anyway even though I will not be using virtually any of the
> > functionality?
>
> I didn't mean you should actually use a navigation controller for
> other purposes than debugging how ViewDidUnload really works
> in a test application. I was under the impression you were testing...
>
> Since you're using a custom UIViewController, you can simply
> monitor DidReceiveMemoryWarning and decide what to do, regardless
> of ViewDidUnload's occurrence.
>
> Robert
> _______________________________________________
> MonoTouch mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=3965401&i=0>
> http://lists.ximian.com/mailman/listinfo/monotouch
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://monotouch.2284126.n4.nabble.com/Proper-UIViewController-UIView-handeling-tp3964036p3965401.html
>  To unsubscribe from Proper UIViewController/UIView handeling, click 
> here<http://monotouch.2284126.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3964036&code=c2hhd25sZWhuZXJAZ21haWwuY29tfDM5NjQwMzZ8LTExMTM0ODIzNDA=>.
>
>



-- 
Shawn Lehner


--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/Proper-UIViewController-UIView-handeling-tp3964036p3965750.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to