0

私のプロジェクトでは、ここにこれらのコードが 10 個あります。

- (void) makeAnim1{

    //downward animation for carousel
    [UIView animateWithDuration:**3.5**
                          delay:0.25
                        options: UIViewAnimationCurveLinear
                     animations:^{
                         carousel.frame = CGRectOffset(carousel.frame, 0, **490**);
                     }
                     completion:^(BOOL finished){ //task after an animation ends
                         [self performSelector:@selector(makeAnim1_1) withObject:nil afterDelay:3.0];
                         NSLog(@"Done!");
                     }];    

}

- (void) makeAnim1_1{

    //upward animation for carousel
    [UIView animateWithDuration:**3.5**
                          delay:0.2
                        options: UIViewAnimationCurveLinear
                     animations:^{
                         carousel.frame = CGRectOffset(carousel.frame, 0, **-480**);
                     } 
                     completion:^(BOOL finished){
                         //timer for the reveal button
                         [NSTimer scheduledTimerWithTimeInterval:0.1 //this arranges the duration of the scroll
                                                          target:self
                                                        selector:@selector(revealButton)
                                                        userInfo:nil
                                                         repeats:NO];   
                         NSLog(@"Done!");
                     }];    


}

たった 1 回の短い実装でそれらを作成したかったのです。したがって、それらは 1 つの関数にすぎません。必要な値を入れて、コードの太字バージョンに割り当ててみました。

互いに対応する 2 つの配列が必要です。例えば:

arrayA[3] = A、B、C;

arrayB[3] = a、b、c;

A が pick の場合、a に等しくなります。

4

1 に答える 1

0

以下のコードを試してください:

以下のコードのように、配列値を大文字または小文字に変換できます。

最初のインデックスが A の配列を含む配列を変換する B 配列の最初のインデックスが A を含む

if([A objectAtIndex:0] lowercaseString].isEqualString([B objectatindex:0])
{

}

ありがとう...!

于 2012-05-04T06:42:00.027 に答える