TM character blows array out of water
TM character blows array out of water
- Subject: TM character blows array out of water
- From: Matt Neuburg <email@hidden>
- Date: Mon, 2 Sep 2002 17:08:24 -0700
I am trying to construct an array of NSStrings one of which contains the TM
character. Here's the code; it's rather long-winded because I had to pull
it apart in order to debug:
- (void) awakeFromNib {
NSArray* arr2;
unichar TM = 8482;
NSString* TMStr = [NSString stringWithCharacters: &TM length:1];
NSString* NAV = [NSString stringWithFormat: @"NAV%@ 6.0 QuickScan", TMStr];
NSMutableArray* arr = [NSMutableArray arrayWithObjects:
@"AppleShare PDS", @"Desktop DB", nil];
[arr addObject: NAV]; // ***
arr2 = [NSArray arrayWithArray: arr];
}
I can see in the debugger that up to the starred line everything is fine;
the array arr has been created, and the string NAV looks the way I want.
But after the starred line - that is, as soon as I try to add this string
to this array - everything goes haywire. Using po in the debugger shows
everything - TMStr, NAV, and arr - as empty! It's as if the attempt to add
this string not only failed silently, it has blown up all the values
connected with it.
Even more bizarre: this problem does not occur with any other Unicode
character I've tried. That is, if you change the value of the integer TM
slightly, everything is fine.
What on earth is going on? Thx - m.
--
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
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.