How to see in Xcode using C ++ std :: vector element types and values?

in visual studio when i was using code debugging with c ++ std :: vector i could see all elements in it and even go to every element, somehow in Xcode 5.1 i can see this parameter
everything i see , these are vector iterators.

this is what i see in Xcode when i try to watch vector elements: std :: vector how can i see vector elements in debug window.

+3


source to share


2 answers


For me (Xcode 6.0.1) this only happens with reference (&) types.

Try one of the following:



  • Add custom expression *&strLineOfChrsVec

    (dereference variable address).
  • Bring up the stack and see the original variable you passed to the function.
+1


source


To temporarily see the values โ€‹โ€‹of one element in the vector, you can right-click on it and then select:

Print Description "[i]"

It will output something like:



Print description * ([1]): (std :: __ 1 :: basic_string, std :: __ 1 :: allocator>) [1] = "Hello"

where "Hi" is the value of the vector at position 1.

0


source







All Articles