문제

i m trying to draw a string with CGContextShowTextAtPoint. CGContextShowTextAtPoint only accepts "const char" as a string input. my problem is that some of the strings have special chars like ä,ö,ü etc in them.

if i convert this strings to a "const char"

NSString *label = @"Küche";
const char *charLabel = [label UTF8String];

i get a strange output, where the ü is replaced with signs and boxes...

what to do?

도움이 되었습니까?

해결책

You can draw only ASCII characters with CGContextShowTextAtPoint. To draw Unicode strings use either NSString UIKit Additions like drawInRect:withFont: or (for more customized drawing) CoreText framework.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top