如何设置NSString drawAtPoint的上下文?

Car*_*loS 3 iphone quartz-graphics ios

我目前正在封装[NSString drawAtPoint:withFont:]对方法的许多函数调用,以便我可以通过单个调用绘制大量字符串,但是如何告诉方法在哪里绘制这些字符串?

如果我传递CGContextRef给它,如何设置CGContextRef当前上下文怎么办?

Joh*_*ger 6

在iOS 4及更高版本中,使用UIGraphicsPushContext(context)和UIGraphicsPopContext()包装NSString drawAtPoint调用.

请参阅"使用NSStrings drawAtPoint方法代替CGContextShowGlyphsAtPoint ..."的已接受答案