我的项目开始出现 PhotoKit header 之一(即 AVCompositionTrackSegment.h
)错误。错误是预期标识符或“(”
,并且它不指向文件中的任何行。当我导入Photos
或MediaPlayer
时会发生这种情况code> 框架到我的 Swift 文件。我正在使用 Xcode 7.3,但我不确定这是否在更新 Xcode 之前开始。我已经删除了派生数据目录并完成了干净的构建,但没有成功。知道为什么 Xcode 被破坏了这边走?
编辑
卸载应用程序后开始使用模拟器。但对于真实的设备没有帮助。
最佳答案
我找到了错误的原因。 AVCompositionTrackSegment.h 已损坏。由于某种原因,行 @property (nonatomic, readonly, getter=isEmpty) BOOL empty;
被替换为 &&
。
编辑
只工作过一次。现在,它在同一文件的空行中给出错误“未知类型名称''”。该文件没有错误,因为它是从其他开发人员的计算机上恢复的。
从头文件末尾删除了以下几行,现在可以编译了。所以看起来像是 Xcode 中的一个错误。向 Apple 提交了错误报告。
/* indicates whether the AVCompositionTrackSegment is an empty segment;
an empty segment has a valid target time range but nil sourceURL and kCMTimeInvalid source start time; all other fields are undefined */
@property (nonatomic, readonly, getter=isEmpty) BOOL empty;
/* indicates the container file of the media presented by the AVCompositionTrackSegment */
@property (nonatomic, readonly, nullable) NSURL *sourceURL;
/* indicates the track of the container file of the media presented by the AVCompositionTrackSegment */
@property (nonatomic, readonly) CMPersistentTrackID sourceTrackID;
关于ios - Apple 的 PhotoKit 的 AVCompositionTrackSegment.h 的编译器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36269025/