Are you sure that your _delegate is not random garbage value at this point?.
if ([_delegate respondsToSelector:@selector(onScoresSubmitted:)])
Make sure the client (delegate) who use the callBack clean the server delegate so that the callBack is not done anymore.
This can be done in two way:
- A: make from the sever side a retain of the delegate (but it's not a
delegate relationship anymore).
- B: assign to nil the delegate pointer when the delegate client
doesn't need the service anymore.
Here a common error, because of a bad implementation:
ADelegateClient* client = [ADelegateClient new];
[SingletonService service].delegate = (id<SingletonServiceDelegate>)client;
[client release];
// you must [SingletonService service].delegate = nil; Since
// [SingletonService service] cannot know the delegate is not pointing to something valid anymore
[[SingletonService service] makeStuffWillCauseCallBackToDelegate];
I didn't read Ray code, if your problem is not similar to this, then i look deep further. But i'm 99% sure it's related to a deallocated pointer problem;