Re: -dataWithPDFInsideRect: unsafe within -drawRect:?

2008-08-30 Thread Joel Norvell
Hi Graham, You might try saving and restoring graphics states for the pertinent NSGraphicsContexts, although this wouldn't seem to explain why your code broke. Sincerely, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

-dataWithPDFInsideRect: unsafe within -drawRect:?

2008-08-29 Thread Graham Cox
I'm getting a problem when I call -dataWithPDFInsideRect: within a view's -drawRect: method. I'm doing this as part of an attempt to cache the contents as a PDF under some circumstances, but I get a number of assertions/exceptions thrown. This was previously working so I'm not sure what's

Re: -dataWithPDFInsideRect: unsafe within -drawRect:?

2008-08-29 Thread Graham Cox
On 30 Aug 2008, at 2:23 pm, Graham Cox wrote: Any ideas? Is it just not safe to try generating a PDF within drawRect? Clarification: these are in two *different* views - i.e. one is in the middle of -drawRect: and creates a new view and calls its - dataWithPDFInsideRect: method.