我的项目开始给出一个PhotoKit头的错误,即AVCompositionTrackSegment.h。错误是Expected identifier or '(',它没有指向文件中的任何行。当我将Photos或MediaPlayer框架导入到Swift文件时,就会发生这种情况。我正在使用Xcode 7.3,但我不确定这是否在更新Xcode之前启动。我已经删除了派生数据目录,并完成了一个干净的构建,但没有成功。你知道为什么Xcode会这样被破坏吗?

编辑
卸载应用程序时,开始使用模拟器。但是有了一个真正的设备却没有用。
发布于 2016-03-30 09:51:09
我找到了错误的原因。AVCompantionTrackSegment.h被破坏了。由于某些原因,行@property (nonatomic, readonly, getter=isEmpty) BOOL empty;被替换为&&。
编辑
只工作过一次。现在,它在同一文件的空行中给出了“未知类型名称‘”错误。该文件没有错误,因为它已从其他开发人员的计算机还原。
从头文件的末尾删除以下行,现在它编译。所以看起来像Xcode中的一个bug。向苹果提交了一份窃听器报告。
/* 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;https://stackoverflow.com/questions/36269025
复制相似问题