swift - Buildtime Canvas Pod xCode 问题 |缺少 [super awakeFromNib] 调用 ||来自 CSAnimationView.m 文件

标签 swift xcode canvas awakefromnib

我刚刚添加了 canvas pod(通过 cocoapods),我可以很好地看到我工作区中的文件,并且我能够将 Canvas“导入”到我的 ViewController.swift 中。但是我收到一个语义构建时间错误,文件 CSAnimationView.m 可能缺少方法 [super awakeFromNib][errorscreenshot] 1

/*
* This file is part of the Canvas package.
* (c) Canvas <usecanvas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

#import "CSAnimationView.h" @implementation CSAnimationView

- (void)awakeFromNib {
if (self.type && self.duration && ! self.pauseAnimationOnAwake) {[self startCanvasAnimation];
}
}

- (void)startCanvasAnimation {

    Class <CSAnimation> class = [CSAnimationclassForAnimationType:self.type];

    [class performAnimationOnView:self duration:self.durationdelay:self.delay];

    [super startCanvasAnimation];
}

@end

最佳答案

自:

1) 您尝试添加的库“Canvas”已有 3 年多未更新,最新版本为 0.1.2,请参见此处:https://github.com/CanvasPod/Canvas/releases

2) Xcode >= 8 需要 [super awakeFromNib],请阅读这里: Calling awakeFromNib of superclass在这里:

You must call the super implementation of awakeFromNib to give parent classes the opportunity to perform any additional initialization they require. Although the default implementation of this method does nothing, many UIKit classes provide non-empty implementations. You may call the super implementation at any point during your own awakeFromNib method.

构建它的唯一方法是手动添加分支 master 并自行修复问题

关于swift - Buildtime Canvas Pod xCode 问题 |缺少 [super awakeFromNib] 调用 ||来自 CSAnimationView.m 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47319962/

相关文章:

ios - Swift 3 - 无法更改我的 Cell.AccessoryView 上的背景颜色

objective-c - 如何从 OS X 应用程序中的 URL 下载文件

ios - 您如何在 XCode 3 中构建和使用 plcrashreporter?

javascript - 为什么没有在这个函数中定义 "sprite"?

javascript - 某些变换是否适用于文本而不适用于矩形?

javascript - 背景进度条 Canvas

ios - 音量按钮通知 iPhone

ios - Swift:将分段 Controller 添加到导航栏,并保留标题+导航按钮

ios - 如何使 UITextView 中的属性字符串可访问?

Swift 如果您在设置中指定非零格式字典,则您的委托(delegate)必须响应选择器 captureOutput :didFinishProcessingPhoto