小编Sha*_*eng的帖子

如何使用名称是Swift中关键字的Objective-C类

我们正在尝试在Swift项目中使用BZObjectStore库(https://github.com/expensivegasprices/BZObjectStore).

但是在这个库中,他们使用'where'作为名称来设置查询条件.

BZObjectStoreConditionModel *fetchCondition = [BZObjectStoreConditionModel condition];
fetchCondition.sqlite.where = @"name = 'sample1' and price > 50";
fetchCondition.sqlite.orderBy = @"name desc";

NSArray *objects = [os fetchObjects:[SampleModel class] condition:fetchCondition error:&error];
Run Code Online (Sandbox Code Playgroud)

但不幸的是,'where'是Swift中的关键字.我们不想手动更改BZObjectStore中的代码.那么有什么办法可以解决这个问题吗?

naming objective-c swift

1
推荐指数
1
解决办法
60
查看次数

标签 统计

naming ×1

objective-c ×1

swift ×1