Objective-C weird appearance in the debugger after the string ByReplacingOccurrencesOfString

I am on Mac OS X and Xcode 4.5.2 while executing these lines:

NSString *asSrcFileName = @"chromebar.png" NSString *asSrcExtName = @".png" NSString *asTempName = [asSrcFileName stringByReplacingOccurrencesOfString:asSrcExtName withString:@""]; 

I get a weird look at my variables in the debugger. See Rectangle: enter image description here I expected asTmp to be @ "chromebar" after the third line. I used stringByReplacingOccurrencesOfString quite often and I don’t know what is wrong. Somehow it seems that there is a problem with Unicode.

Anyone to shed light on me?

+4
source share
1 answer

Do you asSrcTempName after variable initialization (green line showing current execution point below initialization)?

Otherwise, it is possible that only uninitialized memory and lldb display garbage from a previous run.

I could not reproduce your problem in Xcode 4.5.1.

+2
source

Source: https://habr.com/ru/post/1442995/


All Articles