0

我正在创建一个沙盒应用程序,并且已经使用 ServiceManagement 框架自动启动。但是,由于“ServiceManagement.framework 模块映射”现在包含 requires !swift.

这会产生错误 Could not build Objective-C module 'ServiceManagement',并且Module 'ServiceManagement' is incompatible with the feature 'Swift'当我尝试导入 ServiceManagement 时。

如何在没有 ServiceManagement 框架的情况下使用 Swift 进行自动启动?

4

1 回答 1

0

我找到的解决方案是添加一个 Bridging-Header 文件,并在该文件中导入框架。然后它将像以前一样可供 Swift 使用。

#import <ServiceManagement/SMLoginItem.h>
于 2015-07-24T08:47:19.533 回答