简体   繁体   English

问题-具有快速声明bool类型的DBAccess ORM创建表

[英]Issue - DBAccess ORM create table with declare bool type with swift

i am facing issue with create table in DBObject (DBAccess ORM) with declare bool type and Int type field, and also i am not able to declare "description" filed. 我在带有声明布尔类型和Int类型字段的DBObject(DBAccess ORM)中创建表时遇到问题,并且我也无法声明“描述”字段。

//Swift Code:- //SWIFT代码:-

import UIKit 导入UIKit

@objc(Circlelist) @objc(圈子成员)

class Circlelist: DBObject { 类Circlelist:DBObject {

dynamic var name : String!;
dynamic var group_id : NSNumber!;
dynamic var group_id : Int!;   //Getting issue here
dynamic var desc : String!;
dynamic var description : String!; //Getting issue here
dynamic var address : String!;
dynamic var latitude : String!;
dynamic var longitude : String!;
var isdeleted : Bool = false;    //Getting issue here

} }

When i wright " dynamic var isdeleted : Bool!; " at that time give error like " Property cannot be marked dynamic because its type cannot be represented in Objective-C ". 当我写着dynamic var isdeleted:Bool !; ”时,出现类似“ 属性无法标记为动态,因为其类型无法在Objective-C中表示 ”的错误。

动态var isdeleted:布尔!

and when i wright " dynamic var isdeleted : Bool; " at that time give error like " Class circle list has no initialiser ". 当我赖特“ 动态变量被删除:布尔; ”当时给像“ 类圈子列表没有初始化 ”的错误。

动态变量已删除:布尔

Please suggest me perfect solution to know how to fix this issue, give details about DataType and more information about DBAccess. 请向我建议一个完美的解决方案,以了解如何解决此问题,提供有关DataType的详细信息以及有关DBAccess的更多信息。

You don't specify what issues you are getting exactly, but some of them I can guess. 您没有指定确切要解决的问题,但是我可以猜测其中的一些问题。

dynamic var description : String!;

description is a method name on Objective-C classes, so it is a reserved word. description是Objective-C类上的方法名称,因此它是保留字。 The compiler is warning you of this. 编译器会警告您。

dynamic var group_id : Int!;

Int! is not a supported type in Obj-C, as the compiler error is telling you. 在Obj-C中不受支持,因为编译器错误告诉您。 So you will need to use NSNumber. 因此,您将需要使用NSNumber。

var isdeleted : Bool = false;

I'm not clear what the issue might be, except the absence of the dynamic keyword to indicate it's persistence. 我不清楚问题可能是什么,除了没有动态关键字来指示它的持久性。

See this SO article to see a list of supported Objective-C types. 请参阅本文,以查看受支持的Objective-C类型的列表。

DBAccess: long long value supprted or not? DBAccess:是否支持long long value?

If you have more information about the issues you are having then please add it and we will try to help further. 如果您对遇到的问题有更多的了解,请添加它,我们将尽力帮助您。

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

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