The URL string with which to initialize the NSURL object. Must be a URL that conforms to RFC 2396. This method parses URLString according to RFCs 1738 and 1808.
Return Value
An NSURL object initialized with URLString. If the URL string was malformed or nil, returns nil.
不接受汉字,需要先转换成utf8……
(这个是不是太白痴了)
NSURL会返回nil如果你的格式有错误。
只有在格式规范的条件下才会创建一个有效的NSURL类型
参见官方文档
Parameters
The URL string with which to initialize the NSURL object. Must be a URL that conforms to RFC 2396. This method parses URLString according to RFCs 1738 and 1808.
Return Value
An NSURL object initialized with URLString. If the URL string was malformed or nil, returns nil.