xcode4.5画图填充色的有关问题

xcode4.5画图填充色的问题
XCODE4.5
IOS 6.0
能画图,填充颜色没效果。代码如下。
CGContextRef context = UIGraphicsGetCurrentContext(); 
CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
CGContextSetFillColorWithColor(context, [UIColor  redColor].CGColor);
CGContextSetLineWidth(context, 1.0);
CGContextMoveToPoint(context, 10, 10);
CGContextAddLineToPoint(context, 10, 100);
CGContextAddLineToPoint(context, 100, 100);
CGContextAddLineToPoint(context, 100, 10);
CGContextAddLineToPoint(context, 10, 10);
CGContextStrokePath(context);
CGContextFillPath(context);

------解决方案--------------------
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
    CGContextSetFillColorWithColor(context, [UIColor  redColor].CGColor);
    CGContextSetLineWidth(context, 1.0);
    CGContextMoveToPoint(context, 10, 10);
    CGContextAddLineToPoint(context, 10, 100);
    CGContextAddLineToPoint(context, 100, 100);
    CGContextAddLineToPoint(context, 100, 10);
    CGContextAddLineToPoint(context, 10, 10);
    CGContextClosePath(context);                                                                              
//    CGContextStrokePath(context);
    CGContextDrawPath(context, kCGPathFillStroke);

xcode4.5画图填充色的有关问题
这样没问题了