获取语义问题和解析问题:缺少方法声明的上下文和用于暂停和恢复 UIImageviewanimation 方法的预期方法主体。在 MainViewController.h 文件中声明了这两个方法
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
- (void)resumeLayer:(CALayer *)layer;
- (void)PauseLayer:(CALayer *)layer;
@interface MainViewController : UIViewController
@property (nonatomic, retain) UIToolbar *toolbar;
@property (strong)AVAudioPlayer *audioPlayer;
@property (nonatomic, retain) NSTimer * timer;
m 文件中的方法
-(void)pauseLayer:(CALayer*)layer
{
CFTimeInterval pausedTime = [layer convertTime:CACurrentMediaTime() fromLayer:nil];
layer.speed = 0.0;
layer.timeOffset = pausedTime;
}
-(void)resumeLayer:(CALayer*)layer
{
CFTimeInterval pausedTime = [layer timeOffset];
layer.speed = 1.0;
layer.timeOffset = 0.0;
layer.beginTime = 0.0;
CFTimeInterval timeSincePause = [layer convertTime:CACurrentMediaTime() fromLayer:nil] - pausedTime;
layer.beginTime = timeSincePause;
}
我对我在这里没有定义的东西感到困惑。
感谢帮助。