Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am developing an iphone app. It has following page structure, 1.List of game levels in a UITableView 2.Game page

I use "UIViewAnimationTransitionFlipFromRight" between pages

Game page has 3 views, One is a scrollView in that my game grid is drawn. Game grid is a sub class of UIView ,that added to Scrollview. To support zooming i use CATiledLayer to draw the grid(20*20).

MY problem is GameGrid shows white or last played puzzles grid contents for a few seconds and then refresh(flashing) to the new content.

My GameGrid class as follows


 @implementation GameGrid

 return [CATiledLayer class];

 - (id)initWithFrame:(CGRect)frame {   
        if ((self = [super initWithFrame:frame])) {
           CATiledLayer *tempTiledLayer = (CATiledLayer*)self.layer;
           tempTiledLayer.levelsOfDetail = 5;
           tempTiledLayer.levelsOfDetailBias = 2;        
             return self;


-(void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context
 // here i am drawing grid
// filling rect
 // lines
// string etc..
share|improve this question

That's pretty much supposed to happen, it's doing (some of) the drawing in a thread.

It's been a while since I worked on this, but I used

@interface FastCATiledLayer : CATiledLayer

@implementation FastCATiledLayer

    return 0.0;     // Normally it’s 0.25


because I didn't like the forced initial delay. That may help.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.