string value always shows nil in objective C

前端 未结 4 469
野的像风
野的像风 2021-02-01 01:32

I have upgraded to Xcode 5.0. And when I run an app in debug mode and try to print an NSString value in console, it gives me the below error. Any ideas?

         


        
4条回答
  •  遥遥无期
    2021-02-01 02:08

    The reason is stated in the error message: it may have been optimized out.. this means that you are compiling and running your code in an optimized manner.

    you gotta change your compiler optimization level from Fastest,Smallest to none:

    • go to your target build settings
    • search for optimization level
    • change it to none (whatever mode you are in ie debugging, distribution or release)
    • profit

    do the same for your project settings

提交回复
热议问题