OK, I think this is a very stupid problem but it is driving me nuts and I just can't figure out what the problem is (probably too much eggnog over the holidays). I'm trying to create a NSString from two other NSStrings and it seems like everything over a certain number of characters gets cut off.
Everything seems to be working but the texture name and ".tga" do not get appended to the path. I have tested with two shorter strings and they get concatenated as expected.
Very frustrating, any help would be appreciated.
Thanks!
Code:
// Convert texture name to NSString
NSString *ns_texture_name = [NSString stringWithCString:texture_name length:strlen(texture_name)];
// Get the path
NSString *ns_path = [[NSBundle mainBundle] pathForResource:ns_texture_name ofType:@"tga"];
// NSString *full_path = [NSString stringWithFormat: @"%@/%@.tga", ns_path, ns_texture_name];
NSString * full_path = [[NSString alloc] initWithFormat:@"%@/%@.tga", ns_path, ns_texture_name];
Everything seems to be working but the texture name and ".tga" do not get appended to the path. I have tested with two shorter strings and they get concatenated as expected.
Very frustrating, any help would be appreciated.
Thanks!