Thanks Matt - I was beginning to suspect that might be the case, but was hoping 
that there might be some workaround where I could get at the drawn content.

I have done some performance testing and it appears that I'll need to go the 
route of pure layers for most of it (the animation got a bit jerky with 1,000 
layer backed views), but I guess I'll be able to factor out the drawing code 
and then when I want to print, just create an offscreen view and draw into it 
and print it. A bit more work, but probably worth it in order to access the 
power of Core Animation.

I'm a little surprised about your statement that there is going to have to be a 
completely separate codebase for Mac and iOS. I would have thought that if I 
stick to the core graphics / quartz 2D drawing, that it would be reusable. 
Sure, I understand that I would have UIViews instead of NSViews etc, but I 
should be able to reuse large portions of my code - the core data stuff at the 
back end and core animation and basic drawing code at the front end. But then I 
haven't tried it in real life yet, so I could be wrong...


Regards

Gideon

On 15/09/2010, at 12:40 AM, Matt Neuburg wrote:

> Layers are an efficient way of presenting material on the screen and do not
> feature anywhere in the printing story I just told you. A view is not
> drawing its layer's sublayers in its drawRect; the layer draws itself (onto
> the screen).
> 
> So if you want to portray on paper what the user saw on the screen, you'll
> need a view that knows how to draw that in its drawRect. If layers were
> involved in what the user saw on the screen, the view will have to know how
> to draw what those layers were drawing.
> 
> 
...
> 
> As to interoperability of Mac code with iOS code, my experience is that
> there isn't any (Mac has NSRect, iOS has CGRect, etc.) so the problem
> doesn't arise - you're going to have two separate code bases in any case. m.
> 

_______________________________________________

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

Reply via email to