title: Simple way to display the borders of a CGRect?
body: <p>I'm trying to find a way to display the borders of some <code>CGRect</code>s in my iOS program for debugging purposes.  Is there a fairly simple way to do this?  I just need to see where the program is creating these rectangles, so I can track down some odd touch behaviors (or lack thereof).</p>
  
  <p>My class <code>init</code> method:</p>
  
  <pre><code>// Initialize with points and a line number, then draw a rectangle 
  // in the shape of the line
  -(id)initWithPoint:(CGPoint)sP :(int)w :(int)h :(int)lN :(int)t {
      if ((self = [super init])) {
          startP = sP;
          lineNum = lN;
          width = w;
          height = h;
          int type = t;
          self.gameObjectType = kPathType;
  
          // Draw the path sprite
          path = [CCSprite spriteWithFile: @"line.png" rect:CGRectMake(0, 0, 5, height)];
          ccTexParams params = {GL_LINEAR,GL_LINEAR,GL_REPEAT,GL_REPEAT};
          [path.texture setTexParameters:&amp;params];
  
          if(type == 1) {
              path.position = ccp(startP.x, startP.y);
          } else {
              path.rotation = 90;
              path.anchorPoint = ccp(0, 0);
              path.position = ccp(startP.x, startP.y-2);
          }
  
          [self addChild:path];
  
          // Draw the "bounding" box
          pathBox = CGRectMake(path.position.x - (path.contentSize.width/2), path.position.y - (path.contentSize.height/2), path.contentSize.width * 10, path.contentSize.height);
      }
      return self;
  }
  </code></pre>
  
  <p><code>pathBox</code> is the rect in question.</p>