I’m using a method CGPathGetPathBoundingBox that is only available in iOS 4.0. I’m doing a check against NULL to see if it is available as suggested in Apple Docs but I’m getting the following runtime error:
dyld: lazy symbol binding failed: Symbol not found: _CGPathGetPathBoundingBox
Referenced from: /Users/..
Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics
I set the Core Graphics framkework to type “weak”, but to no affect. Same things happens on real device. When I step through in the debugger the if statement is always executed.
if (CGPathGetPathBoundingBox != NULL) {
self.smallBounds = CGPathGetPathBoundingBox(tempPath);
}
else {
self.smallBounds = CGPathGetBoundingBox(tempPath);
}
I got this answer after posting to the Apple Dev Forum, it seems to be a bug:
CGPath.h says
But the docs say it’s a 4.0 function. I believe that’s the problem.
I would file a bug.
I’m not sure what the right workaround is because since the function isn’t properly being weak linked your app will crash on an OS without the function.