简体   繁体   English

iOS CoreML mlmodel文件自动生成模型类文件的快速版本

[英]iOS CoreML mlmodel file auto-generates swift version of model class file

I am using CoreML for my current objc project. 我正在为当前的objc项目使用CoreML。 Normally the .mlmodel file will automatically generate a .h file for me to import the model class in my viewcontroller. 通常,.mlmodel文件将为我自动生成一个.h文件,以将模型类导入到我的viewcontroller中。 But if I import some swift file in the project, the auto generated .h file change to swift version which is not explicit in the project. 但是,如果我在项目中导入一些swift文件,则自动生成的.h文件将更改为swift版本,而该版本在项目中未明确显示。 I can not use it in the objc project. 我不能在objc项目中使用它。 How to make the .mlmodel file auto-generating .h model class in an objc and swift mixed project? 如何在objc和Swift混合项目中使.mlmodel文件自动生成.h模型类?

在项目的“构建设置”中的“ CoreML模型类生成语言”下,选择“ Objective-C”而不是“自动”。

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

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