I’m trying to convert my code to Objective-C ARC and get several errors.
1.:
NSBezierPath *path = [NSBezierPath bezierPath];
CGPathApply(pathRef, path, CGPathCallback); //error
It says: Implicit conversion of an Objective.C pointer to ‘void *’ is disallowed with ARC
2.:
static void CGPathCallback(void *info, const CGPathElement *element) {
NSBezierPath *path = info; //error
[…] }
It says: Implicit conversion of a non-Objective-C pointer type ‘void *’ to ‘NSBezierPath *’ is disallowed with ARC
Any ideas, how I can resolve the problems?
You need to use bridged casts. In this case, you just want the simple
__bridgemodifier, e.g.and