Error: No overload for method destroyAfterCBEvent' takes0' arguments
What is the solution of above problem>???
Chartboost.CBManager.didFailToLoadInterstitialEvent += destroyAfterCBEvent();
void destroyAfterCBEvent (string location)
{
Debug.LogError ("CB Event failed, noads button destroyed");
Destroy (gameObject);
}
These are the code which are used and generating the errors..
You're calling
destroyAfterCBEvent, when you actually want to use a method group conversion to create a delegate to subscribe to the event. You need to take the brackets off (which is what makes it a method call). You want:That's equivalent to:
Or according to your comments:
(The latter surprises me, given the Chartboost documentation.)
As an aside, it would be a good idea to change your code to follow normal .NET naming conventions - events and methods should both be PascalCased. Events should usually have a delegate compatible with
EventHandler, too. (I don't know anything about ChartBoost, so it's possible that some of these problems are nothing to do with you... but the method name is definitely something you can fix.)