GLKit on iOS5: setting texture prevents other drawing
===

I am attempting to do some very simple 2D drawing with GLKit, including using a texture. However, if I load the texture, but don't even use it in the drawing, somehow it prevents the drawing from taking place! I have a feeling there is a very simple answer to this but have spent several days searching fruitlessly.

Here is my setup code:

    -(void) setup {

      effect = [[GLKBaseEffect alloc] init];

      // comment this out - drawing takes place
      texture = [GLKTextureLoader textureWithCGImage:[UIImage imageNamed: @"arrow.png"].CGImage options:nil error: nil];
      if (texture) {
        effect.texture2d0.envMode = GLKTextureEnvModeReplace;
        effect.texture2d0.target = GLKTextureTarget2D;
        effect.texture2d0.name = texture.name;
      };
      // end of comment this out...
  
      effect.transform.projectionMatrix = GLKMatrix4MakeOrtho(0.0, self.bounds.size.width, self.bounds.size.height, 0.0, 1, -1);

    }


Here is my drawing code:


    - (void)drawRect:(CGRect)rect {
    
      GLKVector2 vertices[4];
      GLKVector4 colors[4];
  
      vertices[0] = GLKVector2Make(20.0, 30.0);
      vertices[1] = GLKVector2Make(120.0, 45.0);
      vertices[2] = GLKVector2Make(70.0, 88.0);
      vertices[3] = GLKVector2Make(20.0, 80.0);
  
      for(int i = 0; i < 4; i++) {
    
        colors[i] = GLKVector4Make(0.3, 0.8, 0.5, 1.0);
      };
  
      glClearColor(0.85, 0.05, 0.1, 1.0);
      glClear(GL_COLOR_BUFFER_BIT);
  
      [effect prepareToDraw];
  
      glEnable(GL_BLEND);
      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  
      glEnableVertexAttribArray(GLKVertexAttribPosition);
      glEnableVertexAttribArray(GLKVertexAttribColor);
  
      glVertexAttribPointer(GLKVertexAttribPosition, 2, GL_FLOAT, GL_FALSE, 0, vertices);
      glVertexAttribPointer(GLKVertexAttribColor, 4, GL_FLOAT, GL_FALSE, 0, colors);
  
      glDrawArrays(GL_TRIANGLE_STRIP, 0, 3);

  
      glDisableVertexAttribArray(GLKVertexAttribPosition);
      glDisableVertexAttribArray(GLKVertexAttribColor);
  
      glDisable(GL_BLEND);
    }

