NSString is cutting off characters
NSString is cutting off characters
- Subject: NSString is cutting off characters
- From: Brian Ganninger <email@hidden>
- Date: Sun, 16 Feb 2003 15:39:50 -0600
I've tried every method in NSString to try compositing but the following
lines of code refuse to generate the simplest string ever.
gaugePath = [[NSString alloc] initWithString:@"87.tif"];
This line of code works, but it's a static declaration and I need the 87.tif
to be composited from 2 other strings (a string containing a 2 digit number
from an array of strings, referenced by the var percentUsed)
gaugePath = [[NSString alloc] initWithString:percentUsed];
gaugePath = [gaugePath stringByAppendingPathExtension:@"tif"];
So the simplest solution would seem to be, make a new string with the
percentUsed string and add the path extension. Pass that as the path to a
method call looking inside the bundle, and I can get an numbered image that
way (which is what I'm going for, without declaring 100 static strings to be
able to have a solid path)
But, when I run the above code, or any other stringAppending technique I
could find, the following is what happens:
87.if
If I add a character in front tif this will disappear instead, but this
happens whenever I try to add the . Separator. If I append the string
@".tif" the t will still disappear, If I append @"." and then append @"tif"
the 1st character will disappear.
So no matter what I try I cannot figure out a way to dynamically generate a
string to access the files inside the app's bundle.
Help in this very frustrating matter would be greatly appreciated, as I'm
about ready to throw my PowerBook through my wall, which really wouldn't be
a good path at all for anything :-P
- Brian Ganninger
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.