php - iOS NSString to NSURL results to null pointer? -


this working me:

nsurl *u1 = [nsurl alloc]; u1 = [nsurl urlwithstring:@"http://10.0.0.50/upload.php?file=test.png" relativetourl:nil]; 

but when getting http request:

nsstring* imageremoteurl = [[nsstring alloc] initwithdata:data encoding:nsutf8stringencoding]; nsurl *u1 = [nsurl alloc]; u1 = [nsurl urlwithstring:[imageremoteurl stringbyaddingpercentescapesusingencoding: nsutf8stringencoding]]; 

i this:

http://10.0.0.50/upload.php?file=test.png%0a 

with %0a @ end.

%0a url encoded version of new line character \n, should make sure remove string.

as side note, can remove calls [nsurl alloc] replacing allocated variable in next line.


Comments