I’ve concatenated string using the following code:
NSString *add = @"a ";
lbl.text = [add stringByAppendingString:lbl.text];
Which adds ‘a ‘ to lbl variable every time I call the function.
But for some reason this method concatenates in a way that the new string adds in the beginning of what’s already there, and not to the end.
Instead of getting AAABBB, I get BBBAAA. How do I fix this?
If
a = AAAandb = BBBthen you will need to writeSo in your case it will be
[lbl.text stringByAppendingString:add];aslbl.text = AAAandadd = BBB.For more information about this method please see NSString documentation.