即使datamodel包含实体,ios-mogenerator也不会生成任何实体.报告“在模型中找不到实体.不会生成任何文件.“

前端之家收集整理的这篇文章主要介绍了即使datamodel包含实体,ios-mogenerator也不会生成任何实体.报告“在模型中找不到实体.不会生成任何文件.“前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图让mogenerator(1.26最新)从核心数据模型(xcdatamodel)生成一些锅炉板类,并报告:
No entities found in model. No files will be generated.
(model description: (<NSManagedObjectModel: 0x10012e410>) isEditable 1,entities {
},fetch request templates {
})

即使xcdatamodel的内容显然存在

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model name="" userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="1487" systemVersion="11E53" minimumToolsVersion="Xcode 4.3" macOSVersion="Automatic" iOSVersion="Automatic">
    <entity name="Chair" representedClassName="Chair" syncable="YES">
        <attribute name="name" attributeType="String" maxValueString="50" syncable="YES"/>
    </entity>
...

我究竟做错了什么?

我正在使用Xcode 4.4.1和mogenerator 1.26

解决方法

这是 http://raptureinvenice.com/getting-started-with-mogenerator/的报价

When you create entities in your data model,be sure to populate the
“Class” field with the same name as the entity.

所以你要做的是:

>打开您的数据模型>选择您的实体>在右侧面板中,选择数据模型检查器(第3个)>编辑与“名称”字段同名的“类”字段

原文链接:https://www.f2er.com/iOS/328614.html

猜你在找的iOS相关文章