Я новичок в Quartz 2D и мире контекстов. почему этот код рушится?Сбой CGContextStrokePath (контекст). Зачем?
NSMutableData* pdfData = [[NSMutableData alloc] initWithLength:1000];
CGRect bounds = (CGRectMake(100, 100, 100, 100));
NSDictionary* documentInfo = nil;
UIGraphicsBeginPDFContextToData (pdfData,
bounds,
documentInfo);
CGContextRef context = UIGraphicsGetCurrentContext();
NSLog (@"context: %@", context);
// Drawing lines with a white stroke color
CGContextSetRGBStrokeColor(context, 1.0, 1.0, 1.0, 1.0);
// Draw them with a 2.0 stroke width so they are a bit more visible.
CGContextSetLineWidth(context, 2.0);
// Draw a single line from left to right
CGContextMoveToPoint(context, 10.0, 30.0);
CGContextAddLineToPoint(context, 310.0, 30.0);
CGContextStrokePath(context);
[pdfData release];
Код врезается в CGContextStrokePath (контекст) с EXC_BAD_ACCESS
Спасибо.
Редактировать свой вопрос, чтобы вставить трассировку стека. –