Re: NSString is cutting off characters
Re: NSString is cutting off characters
- Subject: Re: NSString is cutting off characters
- From: Andreas Mayer <email@hidden>
- Date: Sun, 16 Feb 2003 23:46:35 +0100
Am Sonntag, 16.02.03 um 22:39 Uhr schrieb Brian Ganninger:
gaugePath = [[NSString alloc] initWithString:percentUsed];
gaugePath = [gaugePath stringByAppendingPathExtension:@"tif"];
You have a memory leak here. You allocate a string and don't release it.
Make that first line
gaugePath = [[[NSString alloc] initWithString:percentUsed] autorelease];
or short:
gaugePath = [NSString stringWithString:percentUsed];
But, when I run the above code, or any other stringAppending technique
I
could find, the following is what happens:
87.if
I don't know what's wrong with your code, but why don't you just do
this:
gaugePath = [NSString stringWithFormat:@"%@.tif", percentUsed];
or even (assuming percent is an integer):
gaugePath = [NSString stringWithFormat:@"%i.tif", percent];
bye. Andreas.
_______________________________________________
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.