简体   繁体   English

更新我的 XCode 后,出现 Strideable 错误

[英]After updating my XCode, I get a Strideable error

So, I recently updated my MacOS to Catalina and installed XCode 11.5.所以,我最近将我的 MacOS 更新到 Catalina 并安装了 XCode 11.5。 Before that I had High Sierra and the maximum version of XCode that High Sierra supports (don't remember the version number).在此之前,我有 High Sierra 和 High Sierra 支持的 XCode 的最高版本(不记得版本号)。

So, an app I had built on that combo worked fine in XCode, but now after the update when I open I cannot run the app, because I get a Strideable error.因此,我在该组合上构建的应用程序在 XCode 中运行良好,但现在在我打开更新后,我无法运行该应用程序,因为我收到了一个 Strideable 错误。 I have the following code in one of my controllers which worked fine before this:我的一个控制器中有以下代码,在此之前运行良好:

extension Date : Strideable {
    public func advanced(by n: Int) -> Date {
        return Calendar.current.date(byAdding: .day, value: n, to: self) ?? self
    }
    
    public func distance(to other: Date) -> Int {
        return Calendar.current.dateComponents([.day], from: other, to: self).day ?? 0
    }
}

I basically use this for a calendar I am implementing inside the app.我基本上将它用于我在应用程序中实现的日历。

So, now when I try to run the app I get these two errors:所以,现在当我尝试运行应用程序时,我得到了这两个错误:

Protocol 'Strideable' requires 'advanced(by:)' to be available in iOS 11.0.0 and newer协议 'Strideable' 要求在 iOS 11.0.0 和更新版本中提供'advanced(by:)'

Protocol 'Strideable' requires 'distance(to:)' to be available in iOS 11.0.0 and newer协议“Strideable”要求“距离(到:)”在 iOS 11.0.0 和更高版本中可用

As you can see I have both these functions implemented.如您所见,我已经实现了这两个功能。

Inside my app's Deployment Info I have iOS 11.0 as minimum requirement for the app.在我的应用程序的部署信息中,我将 iOS 11.0 作为应用程序的最低要求。

Besides, the current version of the app is published on the App Store and working fine.此外,该应用程序的当前版本已在 App Store 上发布并且运行良好。 What can be the issue here?这里可能是什么问题?

Ok, I am not sure why, but apparently at some point there was an update for Strideable, so the only thing I had to do was delete my Strideable extension.好的,我不知道为什么,但显然在某个时候有一个 Strideable 更新,所以我唯一要做的就是删除我的Strideable扩展。

Once I did that, the app worked without any issues.一旦我这样做了,该应用程序就可以正常工作了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM