我在 NSBezierPath 实例上设置划线样式:
NSBezierPath *path = [NSBezierPath path];
// Get the path information...
NSInteger count = 0;
// Get the array count...
CGFloat *dashLengths = (CGFloat *)malloc(sizeof(CGFloat) * count);
// Populate the array...
CGFloat phase = 0.0f;
// Get the phase...
[path setLineDash:dashLengths count:count phase:phase];
我应该在 dashLengths 上调用 free() 以防止内存泄漏吗?或者稍后释放数组会导致错误?