0

My project started giving errors with one of the PhotoKit headers, namely AVCompositionTrackSegment.h. The error is Expected identifier or '(' and it does not point to any line in the file. This occurs when I import either the Photos or MediaPlayer framework to my Swift file. I'm using Xcode 7.3, but I'm not sure if this started before I updated Xcode. I have removed derived data directory and done a clean build with no success. Any idea why Xcode is broken this way?

enter image description here

Edit

Started to work with the simulator when uninstalled the app. But with a real device that does not help.

Tapani
  • 3,191
  • 1
  • 25
  • 41

1 Answers1

0

I found the reason for the error. AVCompositionTrackSegment.h was corrupted. For some reason the line @property (nonatomic, readonly, getter=isEmpty) BOOL empty; was replace with &&.

Edit

Worked only one time. Now it gives the error "Unknown type name ''" in an empty line of the same file. The file does not have errors as it has been restored from other developer's computer.

Deleted the following lines from the end of the header file and now it compiles. So looks like a bug in Xcode. Filed a bug report to 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;
Tapani
  • 3,191
  • 1
  • 25
  • 41