How can I test an NSString for being nil?

前端 未结 8 1828
借酒劲吻你
借酒劲吻你 2020-12-09 07:12

Can I simply use

if(myString == nil)

For some reason a string that I know is null, is failing this statement.

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-09 07:43

    It seems that my string in the debugger was reporting as (null) but that was due to how it was being assigned, I fixed it and now it is reporting as nil. This fixed my issue.

    Thanks!

提交回复
热议问题