How to check for Nil

后端 未结 4 1192
日久生厌
日久生厌 2021-01-21 13:05

I am currently studying objective-c and the basic c programming language.

I have a questions about a particular line of code:

if (!balance)
4条回答
  •  天命终不由人
    2021-01-21 14:01

    NSLog should return (null) (which probably is description for nil), not NULL in console. Your check should look like this:

     if (!controller) 
     {
         // do some stuff here
     }
    

提交回复
热议问题