iphone - 尝试使用 animateWithDuration 时找不到方法 '+animateWithDuration:delay:options:animations:'

标签 iphone ios cocoa-touch ios4

-(void)fadeLabel{

    UILabel *label = (UILabel *)[self.view viewWithTag:kLabelTag];


    [UIView animateWithDuration:2.0
                          delay:0.0
                        options:UIViewAnimationCurveEaseIn
                     animations:^{

                         label.alpha = 0.0;


                     }];



}

我第一次尝试制作任何东西的动画给了我: 尝试使用 animateWithDuration 时找不到方法“+animateWithDuration:delay:options:animations:”

我不知道导致此错误的原因,但我的代码与所有其他教程和指南相同。

谢谢!

最佳答案

方法其实就是+animateWithDuration:delay:options:animations:completion:。您缺少 completion: 位。如果您不需要完成 block ,您可以将 nil 传递给该参数。

关于iphone - 尝试使用 animateWithDuration 时找不到方法 '+animateWithDuration:delay:options:animations:',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7289473/

相关文章:

iphone - 将 Google map API 集成到 iPhone 应用程序中

iphone - 设置控件后面的 iOS 白色背景

ios - 使用 UIPinchGestureRecognizer 在捏合方向缩放 View

objective-c - 在突出显示/选择单元格时,在自定义 UITableViewCell 中为 UITextField 提供正确的文本颜色

iphone - 在 iPhone 应用程序中手动绘制渐变?

iphone - Obj-C,在上传包含行的数组后刷新表的一部分?

iphone - 通过 UIDataDetectorTypeCalendarEvent 在 iPhone 上为日历事件自动检测哪些日期格式?

ios - 为视网膜显示创建具有抗锯齿功能的圆圈或圆盘

ios - 如何删除使用 xep-0136(消息存档)保存的聊天消息?

objective-c - 选项卡栏 Controller 未正确显示