Reputation: 11
I have a process that collected data. at specific intervals I need to create graphs and send them to a different process as pdf data. I gather the data, create the points and I call [graph reloadData]. The problem is: when will the drawing be finished so I can collect the data using: NSData * pdfData = [graph dataForPDFRepresentationOfLayer];? I can call it with a delay after the reload data but it is a bit fishy. Is there a notification/function to override to know when the drawing is complete?
Thanks
Upvotes: 1
Views: 459
Reputation: 27381
No need for a delay. -dataForPDFRepresentationOfLayer
will make sure the data is up-to-date and render the graph into an offscreen drawing context.
Upvotes: 1