On Tue, 21 Dec 2010 12:52:02 +0000 (GMT), Kenneth Baxter <k.b.bax...@mac.com> said: >Hi, I have an application that needs to display text on both Mac OS X and on >iOS. I'm sticking to core technologies for my drawing and drawing all my stuff >into cgcontexts for maximum portability. > >I sometimes need the user to edit the text, so am planning to add a subview >(NSTextView / UITextView) when the user needs to edit the text. > >What is the best way to minimize the customization for the two versions of the >application, and ensure that when I put the text view over the top, that it is >exactly the same size and shape (kerning/wrapping etc) when drawn in the text >view and when drawn directly in the cg context? > >Any gotcha's I should know about? >
The whole thing is a gotcha. On iOS, at least, the technology that draws a UITextView is different from the lower-level drawing technology, e.g. Core Text. (A tiny obscure hint in the documentation, along with some other clues, leads to me suspect that a UITextView is drawn with WebKit.) So the chances of your getting a physical match is pretty well nil. In my view the entire goal of cross-platform code compatibility (Mac OS X <-> iOS) is pretty well forlorn, and I'd recommend just using higher-level mechanisms on both and dealing with the doubled code base. m. -- matt neuburg, phd = m...@tidbits.com, <http://www.apeth.net/matt/> A fool + a tool + an autorelease pool = cool! AppleScript: the Definitive Guide - Second Edition! http://www.apeth.net/matt/default.html#applescriptthings_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com