Xcode Fails to Report Deprecated Functions

I'm using Xcode 8.3.3 to work on a Mac application, written in Objective C. In both the project and target settings the Apple LLVM 8.1 Warnings - Deprecated Functions are set to yes. My project called CGContextShowTextAtPoint(params). It was pointed out by a user that this was causing text to be displayed incorrectly. I looked at the documentation and it shows this function to be deprecated in OS X 10.9.


Why doesn't Xcode complain about this when I build my project? Is it possible that I'm also missing other deprecated functions?


Also the documentation used to mention newer functions that should be called to replace deprecated functions but doesn't in the documentation for this function.


I have my build settings set to build for OS X 10.6. Yes, this is probably too old. Would setting the build version to an newer OS fix this?

Accepted Reply

Thanks to all of you for your help. In this case deprecating CGContextShowTextAtPoint(params) did break it. It draws something, but not intelligible text at the correct size in my NSImage.


I'll set the build target to a newer version of OS X and see if this helps.

Replies

I understand yes. Deprecation warnings take into account the OSX target.

>> this was causing text to be displayed incorrectly


Keep in mind that deprecated APIs don't not work. The deprecation is advice to you to avoid them, but until they're actually removed they still work just like they always did.


>> documentation used to mention newer functions […] but doesn't in the documentation for this function


This documentation:


https://developer.apple.com/documentation/coregraphics/1586505-cgcontextshowtextatpoint


says to use Core Text instead.

> Would setting the build version to an newer OS fix this?


IIRC, when either a build's base SDK or it's Deployment target is older than the version of macOS when a given API was deprecated, the compiler won't spit out deprecation warnings for that API.

Thanks to all of you for your help. In this case deprecating CGContextShowTextAtPoint(params) did break it. It draws something, but not intelligible text at the correct size in my NSImage.


I'll set the build target to a newer version of OS X and see if this helps.