سؤال

When debugging my app, i get a crash.

the code that the debugger halts at is:

- (void) callDelegate: (SEL) selector withArg: (id) arg error: (NSError*) err
{
    assert([NSThread isMainThread]);
    if([delegate respondsToSelector: selector]) //CODE HALTS HERE
    {
        if(arg != NULL)
        {
            [delegate performSelector: selector withObject: arg withObject: err];
        }
        else
        {
            [delegate performSelector: selector withObject: err];
        }
    }
    else
    {
        NSLog(@"Missed Method");
    }
}

This crashes with EXC_BAD_ACCESS (code-1, address=0x70000000c) every time I cancel the game centre authentication.

Any ideas on how I can fix this, thanks..

P.S. Someone asked what my stack looked like, so here is a pic of the stack

هل كانت مفيدة؟

المحلول

It turned out to be a problem with my delegate references.

I ended up removing all my code and using a fantastic helper made by another programmer.

the link is here: https://github.com/ablfx/ABGameKitHelper

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top