Je suis en train de convertir l'appel api NSString suivant à un objet NSURL:iPhone convertir NSString à l'erreur NSURL
http://beta.com/api/token= « 69439028 »
Voici les objets que j'ai installé. J'ai échappé les guillemets avec des barres obliques inverses:
NSString *[email protected]"http://beta.com/api/token=\"69439028\"";
NSLog(@"theTry=%@",theTry);
NSMutableURLRequest *url = [[NSURL alloc] URLWithString:theTry];
NSLog(@"url=%@",url);
Chaque fois que je lance, je continue à obtenir cette erreur:
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'
Quelqu'un peut-il s'il vous plaît me dire comment je peux convertir cette chaîne en un NSURL correctement?
Ou, vous pouvez obtenir un objet autoreleased avec NSURL * url = [NSURL URLWithString: theTry]; –
@Tom: J'ai essayé "NSURL * url = [NSURL URLWithString: theTry]" et il me renvoie un objet nul. – unicornherder
@ Dutchie432 & Dave: J'ai également essayé "NSURL * url = [[NSURL alloc] initWithString: theEssay", et il me donne aussi un objet nul – unicornherder