I have a UIView subclass that has the following in drawRect:
for(int j=0; j<[myArray count]; j++){
if([myArray objectAtIndex:j]!=@""){
[[UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1] set];
CGContextFillRect(context, CGRectMake(55+(20*j),10,15,5));
[[UIColor blackColor] set];
[[myArray objectAtIndex:j] drawAtPoint:CGPointMake(55+(20*j),3+) withFont:myFont];
}
}
I've logged inside the if statement and it works, but for some reason I still get drawn CGContextFillRects at every iteration of the loop, even when my current array object is @"".
I'm fairly new to drawing, so please excuse me if I'm missing something huge and trivial.