objective c - ARC restriction - Implicit conversion of 'char' to 'NSString *' is disallowed with ARC -


i'm playing mapkit , setting annotations. somewhere in code have :-

#define annotation_first_type 1  unsigned char annotype = annotation_first_type  annotationview = (mkpinannotationview *) [_mapview dequeuereusableannotationviewwithidentifier:annotype ]; 

the last line above throws error implicit conversion of 'char' 'nsstring *' disallowed arc, fair enough, need explicitly change annotype nsstring.

but odd thing is; if line (3) had below instead :-

annotationview = (mkpinannotationview *) [_mapview dequeuereusableannotationviewwithidentifier:**annotation_first_type**];  

it compiles without error? question is, type of annotation_first_type?

annotation_first_type integer. integer can implicitly converted pointer in c, if have enabled warnings compiler should have warned this. don't know why isn't compiler error, oversight.

you should define annotation_first_type nsstring, e.g.

#define annotation_first_type @"1"  

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -