Hi, We do know about this problem and we've tried to come up with at least a partial solution, which will be included in MonoTouch 5.2 when it comes out. I can't say much about it right now (partially because it's quite a complex topic, and I wasn't the one adding this new support), but it is designed to improve this situation a lot. If you download the latest beta (5.1.1) you can try it out already (enable sgen and add --new-refcount to mtouch additional arguments). Documentation about exactly what it fixes (and what it doesn't) is being written, and should be done when 5.2 is released.
Unfortunately it is impossible to fix this problem 100% (which would be to never crash due to objects being freed, while at the same time not leak any objects, no matter what C# code you wrote), because of the differences between the managed world and the underlying iOS world. The GC will still need some help from the developer, but hopefully we've been able to reduce those cases a lot. Rolf On Sun, Jan 15, 2012 at 11:23 PM, rnendel <[email protected]> wrote: > This is going to sound negative, but for all of us Monotouch enthusiasts, > please read between the lines at the heart of the issue and not just read > it > as "flaming" - for monotouch developers, please just read. > ------- > The changes to the garbage collector have got to get fixed. Getting tired > of chasing <unrecognized selector sent to instance> exceptions. Not all > variables can be declared and/or initialized at class scope (that seems to > be the "quick fix" given out for the problem, but really doesn't solve > much) > and I have seen zero productive feedback to anyone reporting the issue > (which many have). > > Part of the c# pattern is a reliable garbage collector that behaves in a > predictable manner. The use of lambda expressions and a reliance on > predictable behavior based on reference count is a key part of what c# is > all about. Requiring variables to be declared at class scope, or allowing > these exceptions to continue with "quick fix" suggestions really doesn't > help much - we're talking about "core language functionality" here, not > optional features. > > The attractiveness of c# over objective C is NOT just the language > semantics/framework, but also the behavior of the backend components, such > as a reliable garbage collector. This is c# not a "kinda c# hack" right? > The objective of MT is a "quicker learning curve" by removing the > Objective-C component. However, if the development pattern must change > (and > take more time tracking down bugs) because of faulty behavior, then the > "value add" of MT is greatly reduced. > > So, please, do something about this or many people coming from stable c# > elsewhere will start to believe that learning Objective-C really isn't such > a bad thing after all. MT is designed to attract existing c# developers, > but if the MT c# implementation and run-time behavior does not match or > come > close to what c# developers would expect will they have a "positive" > experience or a negative one. > -------- > Again, to all those who would respond as MT enthusiasts - believe me, I can > imagine what you'll say, so please don't trash up the thread with flame @ > me, or whatever. The garbage collector is a real problem right now and has > gotta get fixed. And, no, I'm not a noob - been developing in MT for over > a > year and have 20+ years professional development under my belt (mostly in > the PC/console games industry). I simply want this solution to "work" as > expected for the language being used, as do we all I would assume. > > So, devs, please respond and let's get some information going on the > garbage > collector changes. Which of the various errors reported are *really* due > to > an IOS bug and which are due to the collector. So far it is all very vague > and no real information about a "fix" has been provided that I can tell. > I'd ask that you stop addressing specific scenarios, like "when I click my > button I get an <unrecognized selector> in the event handler" and begin > addressing the overall issue, which is the garbage collector. > > Thanks. > > -- > View this message in context: > http://monotouch.2284126.n4.nabble.com/Unknown-selector-and-garbage-collection-tp4297921p4297921.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
