【发布时间】:2012-03-07 09:45:57
【问题描述】:
我正在使用 mapkit 并设置一些注释。在我的代码中某处我有:-
#define ANNOTATION_FIRST_TYPE 1
unsigned char annoType = ANNOTATION_FIRST_TYPE
annotationView = (MKPinAnnotationView *) [_mapView dequeueReusableAnnotationViewWithIdentifier:annoType ];
上面最后一行抛出错误Implicit conversion of 'char' to 'NSString *' is disallowed with ARC,这很公平,我需要将annoType显式更改为NSString。
但奇怪的是;如果对于第 (3) 行,我有以下内容:-
annotationView = (MKPinAnnotationView *) [_mapView dequeueReusableAnnotationViewWithIdentifier:**ANNOTATION_FIRST_TYPE**];
它编译没有错误? 问题是,ANNOTATION_FIRST_TYPE 的类型是什么?
【问题讨论】:
-
下次请处理您的代码格式。
标签: objective-c automatic-ref-counting constants c-preprocessor