<div dir="ltr">Hi,<div><br></div><div>Using Xcode 8.2.1 I just created a brand new document-based Cocoa application using Core Data and Swift. I created a single entity in the Document.xcdatamodeld file. I selected &quot;Class Definition&quot; in the CodeGen pop up menu in the inspector.</div><div><br></div><div>My entity is named PHAudioFile.</div><div><br></div><div>I then asked Xcode to generate the files with the &quot;Create NSManagedObject subclasses&quot;. It generated two files:</div><div><br></div><div><div>- PHAudioFile+CoreDataClass.swift</div></div><div><div>- PHAudioFile+CoreDataProperties.swift</div></div><div><br></div><div>But everything breaks. Building the project, I now get several errors similar to this:</div><div><br></div><div><p style="margin:0px 0px 0px 12px;font-size:11px;line-height:normal;font-family:menlo">&lt;unknown&gt;:0: error: filename &quot;PHAudioFile+CoreDataClass.swift&quot; used twice: &#39;/Users/jdmuys/Phoenix/PHAudioFile+CoreDataClass.swift&#39; and &#39;/Users/jdmuys/Library/Developer/Xcode/DerivedData/Phoenix-buxfnwoppzieggdrogkoajdyimri/Build/Intermediates/Phoenix.build/Debug/Phoenix.build/DerivedSources/CoreDataGenerated/Document/PHAudioFile+CoreDataClass.swift&#39;</p><p style="margin:0px 0px 0px 12px;font-size:11px;line-height:normal;font-family:menlo">
</p><p style="margin:0px 0px 0px 12px;font-size:11px;line-height:normal;font-family:menlo">&lt;unknown&gt;:0: note: filenames are used to distinguish private declarations with the same name</p></div><div><br></div><div>More over, the Xcode editor shows many syntax errors in the generated files.</div><div><br></div><div>PHAudioFile+CoreDataClass.swift contains this:</div><div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">import</span><span style="font-variant-ligatures:no-common-ligatures"> Foundation</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">import</span><span style="font-variant-ligatures:no-common-ligatures"> CoreData</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">@objc</span><span style="font-variant-ligatures:no-common-ligatures">(PHAudioFile)</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">public</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">class</span><span style="font-variant-ligatures:no-common-ligatures"> PHAudioFile: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">NSManagedObject</span><span style="font-variant-ligatures:no-common-ligatures"> {</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">}</span></p></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><span style="font-variant-ligatures:no-common-ligatures">With this error on the &quot;</span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">public</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures"> </span><span style="font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">class</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:11px;font-variant-ligatures:no-common-ligatures"> PHAudioFile</span>&quot; line:</div><div><br></div><div>&quot;Invalid redeclaration of <span style="color:rgb(0,0,0);font-family:menlo;font-size:11px">PHAudioFile</span>&quot;</div><div><br></div><div><div>PHAudioFile+CoreDataProperties.swift starts with this line:</div></div><div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(112,61,170)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">extension</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures">PHAudioFile</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> {</span></p></div><div><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><br></span></div><div>Which breaks with:</div><div><br></div><div>&quot;&#39;<span style="color:rgb(0,0,0);font-family:menlo;font-size:11px">PHAudioFile</span>&#39; is ambiguous for type lookup in this context&quot;</div><div><br></div><div>and of course every line thereafter breaks too.</div><div><br></div><div>Searching for &#39;<span style="color:rgb(0,0,0);font-family:menlo;font-size:11px">PHAudioFile</span>&#39; in my Xcode project, finds only those two files. In particular I can&#39;t find any other declaration for &#39;<span style="color:rgb(0,0,0);font-family:menlo;font-size:11px">PHAudioFile</span>&#39;.</div><div><br></div><div>Am I missing something, or is this broken?</div><div><br></div><div>Thanks,</div><div><br></div><div>Jean-Denis</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>has this line in error:<br></div><div><br></div><div><br></div><div><br></div><div><br></div></div>