I am creating 2 columns down a page. The left column is the "Label", the Right column is the "Data". I'm building and getting the CGSize on the "Data" side because it may wrap down considerably. The "Label" side is pre-configure text and is written after the data.
But the problem comes in if there is no data in an object (nil?). Then the next data write does not get moved down. And the next "Label" get's over written. Here is my code. It repeats for about 20 different attributes.
Thanks in advance. I'm just looking for the cleanest way to #1 check for no "size" (no data was entered by the user), and/or #2 assign a minimum 'size'. here is the code that essentially is going on ..
size = [[self.currentLoad otherTrailers] sizeWithFont:textFont constrainedToSize:CGSizeMake(maxDataWidth, MAXFLOAT) lineBreakMode:NSLineBreakByWordWrapping];
[[self.currentLoad otherTrailers]drawInRect:CGRectMake(kMargin+maxLabelWidth+kColumnMargin, currentPageY, maxDataWidth, maxHeight) withFont:textFont lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentLeft];
[@"Other Trailers" drawInRect:CGRectMake(kMargin, currentPageY, maxLabelWidth, maxHeight) withFont:textFont lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentRight];
currentPageY += size.height;
Get and check the value: