Thanks a lot Craig,
What I just did is:
varroot =newRootElement("Tasks"){newSection("Process
Type"){(MonoTouch.Dialog.Element)newRootElement("Process",newRadioGroup("processtype",0)){newSection(){guarantor,dependent,volunteer
// all these are Elements }}}};
And it now compiles without errors.
Thanks a lot!
Alejandro
________________________________
From: Craig Dunn <[email protected]>
To: Alejandro Vazquez <[email protected]>
Cc: "[email protected]" <[email protected]>
Sent: Tuesday, September 24, 2013 11:31 PM
Subject: Re: [MonoTouch] Error with monotouch.dialog (new monotouch update)
an easy fix is to build up the Sections manually rather than combining it all
into one statement, for example this old code:
Root = new RootElement ("Tasky") {
new Section() {
from t in tasks
select (Element) new StringElement((t.Name==""?newTask:t.Name), t.Notes)
}
};
INSTEAD becomes this -->
List<Element> le = new List<Element>();
foreach (var t in tasks)
le.Add (new StringElement((t.Name==""? newTask:t.Name), t.Notes));
// add to section
var s = new Section ();
s.AddAll (le);
// add as root
Root = new RootElement ("Tasky") { s };
Let us know if you have trouble converting your code - I think you'll need to
flatten out both your Sections. It may not look as pretty but at least it is
unambiguous.
This is not related to Xcode 5 or iOS 7 specifically, I think it is related to
the changed covariance/contravariance handling of generic types in the latest
version of Mono... (someone correct me if i'm wrong there).
On Tue, Sep 24, 2013 at 5:58 PM, Alejandro Vazquez <[email protected]>
wrote:
Hi,
>
>I used to have the following code:
>
>var root = new RootElement ("Tasks"){
>
> new Section ("Process Type")
> {
> new RootElement ("Process", new RadioGroup ("processtype",
>0)){
> new Section (){
> guarantor,dependent, volunteer,// all these are
>Elements
>
> }
> }
> }
> };
>
>
>
>
>
>Now, I update Monotouch SDK, Xcode 5, etc... and when I try to build the
>project I get an error on the following line:
>
>
>new RootElement ("Process", new RadioGroup ("processtype", 0)){
>
>
>with the following error:
>
>
>HumanResources/HumanPendingRequests.cs(18,18): Error CS0121: The call is
>ambiguous between the following methods or properties:
>`MonoTouch.Dialog.Section.Add(MonoTouch.Dialog.Element)' and
>`MonoTouch.Dialog.Section.Add(System.Collections.Generic.IEnumerable<MonoTouch.Dialog.Element>)'
> (CS0121)
>
>
>Any clue on how to fix it and why is now showing that error?
>
>
>Thanks a lot.
>
>Alejandro
>
>
>
>
>
>
>
>_______________________________________________
>MonoTouch mailing list
>[email protected]
>http://lists.ximian.com/mailman/listinfo/monotouch
>
>_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch