From 53d4a714e23c17b9595b8194163574395bc66223 Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Wed, 17 Sep 2008 18:59:30 -0700 Subject: [PATCH] Fix for requiring delegate methods (#36), and for JSONP not calling the run loop. [#36 state:resolved]; --- AppKit/CPAnimation.j | 5 +++-- Foundation/CPJSONPConnection.j | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/AppKit/CPAnimation.j b/AppKit/CPAnimation.j index 11eed88a5a..080f19daf5 100644 --- a/AppKit/CPAnimation.j +++ b/AppKit/CPAnimation.j @@ -211,7 +211,7 @@ ACTUAL_FRAME_RATE = 0; - (void)startAnimation { // If we're already animating, or our delegate stops us, animate. - if (_timer || _delegate && ![_delegate animationShouldStart:self]) + if (_timer || _delegate && [_delegate respondsToSelector:@selector(animationShouldStart)] && ![_delegate animationShouldStart:self]) return; _progress = 0.0; @@ -258,7 +258,8 @@ ACTUAL_FRAME_RATE = 0; window.clearTimeout(_timer); _timer = nil; - [_delegate animationDidStop:self]; + if ([_delegate respondsToSelector:@selector(animationDidStop:)]) + [_delegate animationDidStop:self]; } /* diff --git a/Foundation/CPJSONPConnection.j b/Foundation/CPJSONPConnection.j index 521b6661bb..0f529d39be 100644 --- a/Foundation/CPJSONPConnection.j +++ b/Foundation/CPJSONPConnection.j @@ -56,6 +56,8 @@ CPJSONPConnectionCallbacks = {}; { [_delegate connection:self didReceiveData:data]; [self removeScriptTag]; + + [[CPRunLoop currentRunLoop] performSelectors]; }; if(shouldStartImmediately)