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