Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 495 [details]
file with the problem
ihave a strange issue, when i press on the touchdown,...of the buttonrund in Servercell.cs the app crashes....and i have simpyl no idea why?
Maybe i have not understood something, maybe it is a bug,...
maybe u can additionally show me how to rise an UIactionsheet from there
It's a known issue (see bug #134) where MonoTouch is not (yet) able to hide the GC actions from developers.
When you override GetCell, i.e. "public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)", like you're doing in both:
* Siemens3G/DetailtabelleDataSource.cs (86, 37)
* Siemens3G/HaupttabelleDataSource.cs (62, 37)
what happens is that you're overriding a native (ObjectiveC) object, i.e. the caller is native. So if you create a managed instance (the cell) and return it then that *managed* instance won't exists anymore (only the native part will). That makes the object without any reference and the GC can (and does) collect it. When your application goes back into managed code to access the cell, it's not there and the crash occurs.
The workaround (for current releases of MonoTouch) is to keep manual reference to the cells you are creating. E.g.
private List<UITableViewCell> cells = new List<UITableViewCell> ();
Since a managed reference will exists to your cells, they won't be collected and no crash will occur. I tried it on your attachment and, with the workaround in place, cannot get it to crash.
We'll likely have a better, less intrusive fix, in the future but until then let us know if this solve your issue (and I'll mark it as a duplicate of #134 so you'll get an email when that better fix becomes available).
note: for UIactionsheet you better ask on stackoverflow.com or on the mailing-list
Andreas: you probably want to use UIAlertView and not UIActionSheet, in which case:
UIAlertView alert = new UIAlertView ("Error!", ex.Message, null, "Dismiss", null);
I wanted to use a uiactionsheet,...starting from the bottom,...
the cell problem is not solved yet :/
> I wanted to use a uiactionsheet,...starting from the bottom,...
>> note: for UIactionsheet you better ask on stackoverflow.com or on the
> the cell problem is not solved yet :/
I think we're not understanding each other correctly. Can you show me how you applied the suggestion from comment #6 into your code ?
damned my fault :/ i am sry!
There's no fault, just unsolved mysteries ;-)
Does it means you got your cell-issue under control ?
ok, closing bug.
Please bring your UIActionSheet question to the mailing-list where more eyes and brains will be available to provide guidance.