You really need Sebastian to do the definitive reply (again - he's
done it a few times), but my understanding is that it's caused when:

you have an object which has a Obj-C/unmanaged peer (eg UITableViewController)

you release it, so the GC releases the managed version. the unmanaged
side doesn't as the ref-count isn't 0.

something in ObjC/unmanaged says "hey, I want to use that object", and
the ObjC/native part of your app trys to recreate the managed peer....
which it can't do unless you have the intptr constructor (and even
then, it wouldn't have your state in it)

That might help, but it can depend on your situation.

> UIImage's PNG loading is asynchronous (this is a fact).

FromFile is. FromBundle isn't (or is it the other way around?)

> If I have a UITableView now (together with its controller) that is using
> cells and those in turns use PNGs, the cell might be loaded and used before
> the PNG has been loaded, right?

In theory yes.

> This again is leading me to the conclusion: if the UITableView and/or its
> controller is already gone (removed from the view hierarchy and no longer
> referenced by managed code) before UIImage has finished loading, could it
> then happen that the UITableViewController gets resurrected via the IntPtr
> c'tor?

I suspect it could, but it sounds like a bit of an edgy-edge-case. I
guess this is what you are seeing? Can you change your load to be the
other one (FromFile -> FromBundle or the other way)?

> Why am I asking? Because most of the IntPtr calls seem to happen in
> combination with table views and I'm wondering if the above scenario could
> cause it.

Other than the above, I'll leave it to those who jump in with machine
level debuggers. :)

N


-- 
Nic Wise
t.  +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
b. http://www.fastchicken.co.nz/

mobileAgent (for FreeAgent): get your accounts in your pocket.
http://goo.gl/IuBU
Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
Nearest Bus: find when the next bus is coming to your stop. http://goo.gl/Vcz1p
London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to