URLWithString: returns nil

后端 未结 8 1936
遥遥无期
遥遥无期 2020-12-02 13:12

it may be very easy, but I don\'t seems to find out why is URLWithString: returning nil here.

//localisationName is a arbitrary string here
NSSt         


        
8条回答
  •  佛祖请我去吃肉
    2020-12-02 13:14

    NSURL URLWithString:@"" will return nil if the URL does not conform to RFC 2396 and they must be escaped

    If you read through rfc2396 in the link you will get loads of details

    A great site I found for checking where the offending character is, choose the path option for URL

    http://www.websitedev.de/temp/rfc2396-check.html.gz

提交回复
热议问题