我慢してください、これは説明するのが難しいです。ここで何が起こっているのかを知っているヒーローがいるといいのですが。いくつかの履歴が必要です。
私のココア オブジェクトの 1 つである「ボール」は、小さなグラフィックを表しています。ビュー内でのみ意味があります。Ball のメソッドの中には、ビューに再描画を要求するものがあります。最も重要なことは、Ball の位置パラメーターが設定されるたびに、ビューに再描画を要求することです。これはセッターで実現されます。
提案されているように、ここに一口があります:
In View.m
- (void)mouseUp:(NSEvent *)theEvent {
    if (![runnerPath isEmpty]) {
        [walkPath removeAllPoints];
        [walkPath appendBezierPath:runnerPath];
        [runnerPath removeAllPoints];
        [[self held] setStep:0];
        [[self held] setPath:walkPath];
        [NSTimer scheduledTimerWithTimeInterval:.01 target:[self held] selector:@selector(pace) userInfo:nil repeats:YES];
        }
}
Ball.mで
 - (void)pace { 
    CGFloat juice = 10;
    BOOL loop = YES;
    while (loop) {
        if ([self step] == [[self path] elementCount]) {
            if ([[self timer] isValid]) {
                [[self timer] invalidate];
            }
            [[self path] removeAllPoints];
//          @throw([NSException exceptionWithName:@"test" reason:@"reason" userInfo:nil]);
        }
        if (loop) {
            CGFloat distance;
            NSPoint stepPoint;
            if ([[self path] elementCount] > 0) {
                NSPoint returnPoints[2];
                [[self path] elementAtIndex:[self step] associatedPoints:returnPoints];
                stepPoint = returnPoints[0];
                distance = pixelDistance([self position], stepPoint);
            }
            if (distance <= juice) {
                [self setPosition:stepPoint];
                if (distance < juice) {
                    juice -= distance;
                    loop = YES;
                    [self setStep:[self step]+1];
                } else {
                    loop = NO;
                }
            } else {            
                NSPoint cutPoint = moveAlongBetween([self position], stepPoint, juice);
                [self setPosition:cutPoint];
                loop = NO;
            }
        }
    }
}