PerformSelector: What is wrong with this code

mtimmermmtimmerm USMember ✭✭

Hi,

What is wrong with the PerformSelector code?

[Export("voidendbgtask:")]
    void stopAndResetBgTaskIfNeeded()
    {
        LogToScreen();
        if (isManagerRunning)
        {
            stopBackgroundTask();
        }
        else
        {
            stopBackgroundTask();
            startBackgroundTask();
        }
    }
    private void checkLocationTimerEvent()
    {
        LogToScreen();
        stopCheckLocationTimer();
        startLocationManager();

        Selector s = new Selector("voidendbgtask:");
        UIApplication.SharedApplication.PerformSelector(s, null, 5.0);
    }

When I do this I get an error: Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[UIApplication voidendbgtask:]: unrecognized selector sent to instance 0x14da2a90

Tagged:

Best Answer

Answers

  • mtimmermmtimmerm USMember ✭✭

    Thanks. Problem solved!! :)

Sign In or Register to comment.