I'm trying to combine strings with numbers to load dynamic a texture. I found out that the behavior is different if I use a NSString and assign a static string or I combine the string with a number.
// version 1
NSString* textureName;
textureName = @"texture_1";
// version 2
NSString* textureName;
textureName = [NSString stringWithFormat:@"texture_%i ",index];
When I try to get an item from my dictionary with textureName as my key I get the item with the first version of my code but I dont get it with the second version.
The debugger shows in version 1 the type "_NSCFConstantString" and in version 2 the type "_NSCFString".
How can I get an item out of my dictionary with a dynamic string?
indexand where you try to retrieve the value?index, where, how is it declared?