FROM : Greg Titus
DATE : Wed Jan 02 21:34:19 2002
On Wednesday, January 2, 2002, at 05:27 AM, Rosyna wrote:
> Then how do you put an ellipse in an NSString?
>
> Ack, at 1/2/02, Ondra Cada said:
>
>> We are not. Unless something have changed with new Apple tools, only
>> 7-bit
>> chars are OK in @"...". You should never use non-ASCII characters in
>> @"...", since the results would be more or less random
>>
>> It was even documented somewhere (can't remember just now whether in
>> Compiler docs, or Release Notes, or whatever, and don't have time to
>> search
>> docs) for years.
We generally use the Unicode hex value, like so:
+ (NSString *)stringWithCharacter:(unichar)aCharacter;
{
return [[[NSString alloc] initWithCharacters:&aCharacter length:1]
autorelease];
}
+ (NSString *)horizontalEllipsisString;
{
return [self stringWithCharacter:0x2026];
}
(Slightly simplified from NSString extensions in OmniFoundation.)
Hope this helps,
--Greg
DATE : Wed Jan 02 21:34:19 2002
On Wednesday, January 2, 2002, at 05:27 AM, Rosyna wrote:
> Then how do you put an ellipse in an NSString?
>
> Ack, at 1/2/02, Ondra Cada said:
>
>> We are not. Unless something have changed with new Apple tools, only
>> 7-bit
>> chars are OK in @"...". You should never use non-ASCII characters in
>> @"...", since the results would be more or less random
>>
>> It was even documented somewhere (can't remember just now whether in
>> Compiler docs, or Release Notes, or whatever, and don't have time to
>> search
>> docs) for years.
We generally use the Unicode hex value, like so:
+ (NSString *)stringWithCharacter:(unichar)aCharacter;
{
return [[[NSString alloc] initWithCharacters:&aCharacter length:1]
autorelease];
}
+ (NSString *)horizontalEllipsisString;
{
return [self stringWithCharacter:0x2026];
}
(Slightly simplified from NSString extensions in OmniFoundation.)
Hope this helps,
--Greg






Cocoa mail archive

