2017-03-08 56 views
0

我比较两个NSURL它们是相同的,但如果条件失败比较NSURL或字符串中迅速2

 if (url.absoluteString == self.currentPlayer?.currentAssetURL()) 


values 
(lldb) po url.absoluteString 
"Optional(https://a.t/y.mp3)" 

(lldb) po self.currentPlayer?.currentAssetURL() 
▿ Optional("https://a.t/y.mp3") 
    - Some : "https://a.t/y.mp3" 

两个URL相同,但如果条件失败。 请建议。 在此先感谢!

+1

“NSURL”和“NSString”的打印结果看起来相同,但类别不同。 '.absoluteString'返回一个字符串 – vadian

回答

0

我找到了答案。问题是可选的,添加到字符串内部和字符串之外。 我修好了。