I have a uiscrollview within three subUIViews 1, 2, 3. I load content for subUIView1, 2,3 dynamically. Here are steps
- I create scrollview with these 3 subUIview and with a default size for each subUIView
I create an operation for each subUIView, let us say Operation 1,2,3. add to operation queue
every Operation (operation 1) calculate the content that will be later draw in related subUIView (subview 1). after calculate completed, create CGLayer and attach it with UISubview1. reset all UIsubviews frame and bound and layout scrollview subviews and setNeedDisplay for related subUIview1. then move to next operation
in SubUIView drawRect method, i call CGLayerDrawInRect.
then occasionly i get this error Invalid Context. sometimes, it work fine, no error sometime it happened
Any idea about this error will be welcome.
.