views:

47

answers:

2

Currently following the HelloWorld Tutorial on the monotouch website.

I add the following code as per the tutorial:

        int ntaps = 0;
        button.TouchDown += delegate { 
            label.Text = "I have been tapped " (++ntaps) + " times";
        };

However, when I build I get this error in regards to line 3 of the code above: "Expression denotes a 'value', where a 'method group' was expected".

Any ideas what might be going wrong?

+3  A: 

You're missing a plus operator in the string concatenation:

int ntaps = 0;
button.TouchDown += delegate { 
    label.Text = "I have been tapped " + (++ntaps) + " times";
};
StefanO
A: 

You're missing the + after "I have been tapped ";

    int ntaps = 0;
    button.TouchDown += delegate { 
        label.Text = "I have been tapped " + (++ntaps) + " times";
    };
John Boker