Seth
Seth

Reputation: 8373

Errors with MonoDevelop HelloWorld

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?

Upvotes: 1

Views: 479

Answers (2)

John Boker
John Boker

Reputation: 83699

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

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

Upvotes: 0

StefanOS
StefanOS

Reputation: 2748

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

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

Upvotes: 3

Related Questions