Estoy tratando de convertir la siguiente llamada a la API NSString a un objeto NSURL:iPhone convertir NSString a un error NSURL
http://beta.com/api/token= "69439028"
Éstos son los objetos que tengo de configuración. He escapado de las comillas con barras invertidas:
NSString *[email protected]"http://beta.com/api/token=\"69439028\"";
NSLog(@"theTry=%@",theTry);
NSMutableURLRequest *url = [[NSURL alloc] URLWithString:theTry];
NSLog(@"url=%@",url);
Cada vez que corro esto, sigo recibiendo este error:
2010-07-28 12:46:09.668 RF[10980:207] -[NSURL URLWithString:]: unrecognized selector sent to instance 0x5c53fc0
2010-07-28 12:46:09.737 RF[10980:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSURL URLWithString:]: unrecognized selector sent to instance 0x5c53fc0'
Puede alguien por favor dígame cómo puedo convertir esta cadena en un NSURL correctamente?
O bien, se puede obtener un objeto autoreleased con NSURL * url = [NSURL URLWithString: theTry]; –
@Tom: Intenté "NSURL * url = [NSURL URLWithString: theTry]" y me sigue devolviendo un objeto nulo. – unicornherder
@ Dutchie432 & Dave: También probé "NSURL * url = [[NSURL alloc] initWithString: theTry]", y también me da un objeto nulo – unicornherder