0

I am currently having a strange problem with my xCode 5.0: an object appears to be nil in the console, but at the same time its able to be accessed by code.

pic 1: nil downloader with all properties set to nil pic 1.1: nil

pic 1: the object appears to be nil

pic 2: output of NSLog pic 2: output of NSLog(@"%@", imgDownloader) is not nil, the delegate is also getting called normally

By the way, I never intent to make this object nil, you can see from the code that I initialised the object like how I should, but somehow it ended up as nil in the console.

Why is it like this? Is this a bug in the new xCode?

5
  • The Xcode debugger variables view is sometimes plain wrong. Try po ... in the debugger console instead. Commented Dec 6, 2013 at 14:02
  • Taking a wild guess here, could it be that it is on background thread? Or am I totally wrong here @MartinR? Commented Dec 6, 2013 at 14:03
  • Hi Mikael, no it is not on a background thread. Commented Dec 6, 2013 at 14:06
  • Sure looks like a bug. Tried to reproduce it with custom class, cannot. Commented Dec 6, 2013 at 14:08
  • There's lot of bugs with Clang and debug symbol + Xcode. Dunno wich one is responsible. Sometimes local variables never appears, and sometime you can't output them because the object is "nil", even if in the breakpoint stack it appears it is not. So that you need to re-run with logs inside. Seems it worked better with gdb Commented Dec 6, 2013 at 14:28

1 Answer 1

6

You probably building in release mode, change the build mode to debug in the scheme.

Sign up to request clarification or add additional context in comments.

1 Comment

Exactly! I forgot to change the scheme setting back.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.