Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

View Auto Released By GC

$
0
0

Today, when build application to test, I found a problem that 1 viewcontroller is released automatically after appear on screen.

I have some view, which override Dispose function like this:

public class MyView : UIView(){ // some functions

protected override void Dispose(bool disposing){ foreach(UIView view in Subviews){ view.RemoveFromSuperView(); view.Dispose(); } Base.Dispose(); } } And application throw an exception with message: UIKit is not invoke in MainUIThread, it seem to be GC try to finalize something and causing this. But I saw something really strange here: 1. MyView is actually using in my ViewController 2. It only occur with Debug Mode on iPad running iOS7.0.6, if I build in release mode, I don’t get this 3. If I run on Simulator, problem not occur also

I don’t think this is occurred when we during development, because I already checked out iOS-5 Brach, which are tested carefully and doesn’t meet this problem before and build it again, this problem is happened also. It would be nice if you can give us some advices.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>