When I’m stopped at a break point in Xcode, I can see the value of NSString variables. How can I change them? I can change int or double variables, but not NSString.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do this in the debug console. Say you have
NSString* myVar. In the console, after(gdb), typeset myVar = @"My new string". If you are using(lldb), then use the equivalent expressionexpr myVar = @"My new string"instead.This may not show up correctly in the variables panel, but you can verify the value by entering
po myVarinto the console. Your code should pick up the new value.For some great info about using
expr, check out this StackOverflow post.