Value of optional type 'NSURL?' not unwrapped; did you mean to use '!' or '?'?

后端 未结 1 1400
心在旅途
心在旅途 2021-01-26 23:01

I started a Swift project with Xcode 6 Beta 6. The project was also using Core Data. After upgrading to Xcode 6 GM, I am getting the following error when compiling:



        
1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-26 23:54

    ok I just unwrapped the optional using '!' and the code is compiling now.

    return NSManagedObjectModel(contentsOfURL: modelURL!)

    0 讨论(0)
提交回复
热议问题