CoreFoundation functions follow the "create rule". If the function has a "Create" in it it returns an object with a reference count of 1.
Unfortunately your method is not a c function.
So you should turn your Objective-C method into a C function. Something like this:
CGPathRef CreatePath(CGPoint center, CGFloat innerRadius, CGFloat outerRadius, CGFloat startAngle, CGFloat endAngle) {
// your code here
}
This should please the analyzer and work correctly with ARC.
In a Objective-C method you can get similar behaviour by starting your method signature with new
, alloc
, copy
or mutableCopy
. Starting the method with new
probably fits your case best.
Something like this should please the analyzer, but I am not sure if it works correctly with ARC. You have to profile this.
- (CGPathRef)newPath:(CGPoint)center innerRadius:(CGFloat)innerRadius outerRadius:(CGFloat)outerRadius startAngle:(CGFloat)startAngle endAngle:(CGFloat)endAngle {
// your code here
}