The problem is that the last line throws this error: Implicit conversion of
tipoServidor
(akaenum tipoServidor
) toNSString *
is disallowed with ARC
ARC or not, an enum
is not an NSString
, so you cannot do it. In order to deal with it, either define an array of strings that represent your enum
values, or write a small function that does the mapping, for example, like this:
NSString *DescriptionOfServidor(tipoServidor e) {
switch (e) {
case SERVIDOR_ARG: return @"SERVIDOR_ARG";
case SERVIDOR_EU: return @"SERVIDOR_EU";
case SERVIDOR_US: return @"SERVIDOR_US";
}
return nil;
}
All you need now is this call:
NSString *server = DescriptionOfServidor([settings servidorType]);