Re: stringWithFormat / Rendering Text (iOS)
Re: stringWithFormat / Rendering Text (iOS)
- Subject: Re: stringWithFormat / Rendering Text (iOS)
- From: Fritz Anderson <email@hidden>
- Date: Thu, 24 May 2012 17:16:55 -0500
On 24 May 2012, at 1:57 PM, Jason Teagle wrote:
> If the CGContextXXX methods shouldn't be used, then they shouldn't be in the API - or should be marked as deprecated. There's nothing in the docs (with Xcode 3.X, at least - maybe it's changed since) to indicate that these were the worst way possible to render text. If you're trying to learn this stuff from the docs it's pretty discouraging to be led astray. People (elsewhere, not saying anyone here did it) like to tell us to RTFM but that just shows you where that got me.
First, "the CGContextXXX methods" (Quartz/Core Graphics) are irreplaceable API in constant use. Believe me, nobody has told you to ignore Core Graphics.
What you have been told is that the Core Graphics primitive _for drawing text_ should not be used _for your purpose._ CG text drawing is exactly what you'd need if you were hand-rendering PDFs. You weren't anywhere near there.
(Even the more-common applications of Core Graphics often have simpler, higher-level equivalents in UIKit. You've already found the UIKit extensions to NSString. See also UIBezierCurve for easier shape drawing, and Core Animation for composing an interface out of independent, persistent elements.)
Second — and I think you have been told this here — trolling the bottom-level documentation to pick out API that looks relevant to your concepts is the wrong way to get into Cocoa. Crawling through the API at micro scale is what got you into this corner.
We're not being patronizing when we urge you to read the conceptual documents FIRST. Even if you already know everything from elsewhere. Cocoa is not Windows/Android gone wrong. It is based on its own coherent conceptual foundation, and you really do have to understand the common themes before you can grasp the details.
For a better exploration for why the documentation is as it is, and how to approach it, see <http://www.cocoabuilder.com/archive/cocoa/206957-the-challenge-for-cocoa-on-line-documentation.html> — at least read the first post, by the incomparable Erik Buck.
— F
--
Fritz Anderson -- Xcode 4 Unleashed: Now in stores! -- <http://x4u.manoverboard.org/>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden