runtime sdk for ios 100.0在oc工程中无法使用Feature查询服务?

AGSServiceFeatureTable *featuretable=[AGSServiceFeatureTable serviceFeatureTableWithURL:[NSURL URLWithString:@"http://1j5x344819.51mypc.cn:30 ... ot%3B]];
AGSQueryParameters *queryParameters=[[AGSQueryParameters alloc] init];
queryParameters.whereClause=@"NAME = '成都'";

[featuretable queryFeaturesWithParameters:queryParameters completion:^(AGSFeatureQueryResult *result, NSError *error) {
if (error!=nil) {
NSLog(@"%@",error);
}else{
NSArray *array=result.featureEnumerator.allObjects;
AGSFeature *feature=array[0];
[self.mapView setViewpointGeometry:feature.geometry completion:nil];
NSLog(@"%@",feature.geometry);
}
}];
已邀请:

马克玲

赞同来自:

我试了下OC中也是可以查询的。但是需要注意,查询触发前,要保证featureTable已经完成了初始化。
 
[self.featureTable loadWithCompletion:^(NSError * _Nullable error) {
        [self queryForStat];
    }];
 
100中,所有资源对象的初始化过程进行了重新设计,正好我上周新些了一篇相关的文章,您可以参考:http://zhihu.esrichina.com.cn/article/2835

jydfdfdf

赞同来自:

没用啊!在swift工程中不管是否初始化都能成功调用查询,但在oc工程中不管是调用swift代码还是用oc都无法调用, 不知为什么

要回复问题请先登录注册