Cocoa touch ios4中的动画问题

Cocoa touch ios4中的动画问题,cocoa-touch,ios4,uiimageview,Cocoa Touch,Ios4,Uiimageview,我在iOS 4中设置动画时遇到问题。以下是ViewDidLoad方法中的代码: //---animate the two views flipping--- [UIView beginAnimations:@"flipping view" context:nil]; [UIView setAnimationDuration:0.5]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimation

我在iOS 4中设置动画时遇到问题。以下是ViewDidLoad方法中的代码:

 //---animate the two views flipping---
[UIView beginAnimations:@"flipping view" 
 context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight:tempImageView
 cache:YES];

[tempImageView setHidden:YES];

[UIView commitAnimations];

[UIView beginAnimations:@"flipping view" 
            context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight:tempImageView
                     cache:YES];

[UIImageView setHidden:NO];

[UIView commitAnimations];
在代码编译时,我收到一条消息,该消息读取方法“+setAnimationTransition::cache:”未找到(返回类型默认为“id”)

当我点击页面控件时,应用程序崩溃了。以下是控制台所说的:

2011-06-18 14:06:48.249 UsingViews[2093:207] +[UIView setAnimationTransition::cache:]: unrecognized selector sent to class 0x58f3b4
2011-06-18 14:06:48.255 UsingViews[2093:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIView setAnimationTransition::cache:]: unrecognized selector sent to class 0x58f3b4'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x00dc25a9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x00f16313 objc_exception_throw + 44
    2   CoreFoundation                      0x00dc417b +[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x00d33966 ___forwarding___ + 966
    4   CoreFoundation                      0x00d33522 _CF_forwarding_prep_0 + 50
    5   UsingViews                          0x00002d97 -[UsingViewsViewController pageTurning:] + 935
    6   UIKit                               0x000144fd -[UIApplication sendAction:to:from:forEvent:] + 119
    7   UIKit                               0x000a4799 -[UIControl sendAction:to:forEvent:] + 67
    8   UIKit                               0x000a6c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
    9   UIKit                               0x001cdfaa -[UIPageControl endTrackingWithTouch:withEvent:] + 386
    10  UIKit                               0x000a578b -[UIControl touchesEnded:withEvent:] + 381
    11  UIKit                               0x00038ded -[UIWindow _sendTouchesForEvent:] + 567
    12  UIKit                               0x00019c37 -[UIApplication sendEvent:] + 447
    13  UIKit                               0x0001ef2e _UIApplicationHandleEvent + 7576
    14  GraphicsServices                    0x00ffb992 PurpleEventCallback + 1550
    15  CoreFoundation                      0x00da3944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
    16  CoreFoundation                      0x00d03cf7 __CFRunLoopDoSource1 + 215
    17  CoreFoundation                      0x00d00f83 __CFRunLoopRun + 979
    18  CoreFoundation                      0x00d00840 CFRunLoopRunSpecific + 208
    19  CoreFoundation                      0x00d00761 CFRunLoopRunInMode + 97
    20  GraphicsServices                    0x00ffa1c4 GSEventRunModal + 217
    21  GraphicsServices                    0x00ffa289 GSEventRun + 115
    22  UIKit                               0x00022c93 UIApplicationMain + 1160
    23  UsingViews                          0x000023b9 main + 121
    24  UsingViews                          0x00002335 start + 53
)
terminate called after throwing an instance of 'NSException'
(gdb) 

你能告诉我怎么了吗?提前谢谢

方法名称为
setAnimationTransition:forView:cache:
not
setAnimationTransition::cache:

改变

[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight:tempImageView cache:YES];

[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:tempImageView cache:YES];