Turn Deprecation Warnings Back On - objective-c

After creating a new target in an iOS project, there are tons of deprecation warnings. I want to see these in the other targets, too.
I've searched my whole project for deprecated (as this answer would indicate) and I've also looked for -W (as mentioned here), and found that I did do this:
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
in one or two places, but that's not it. I've looked at most answers regarding suppressing warnings, but I haven't found where I shut this off.
Where else might deprecation warnings been shut off? I would like to turn my warnings back on.
Example
This should result in a warning:
self.numericLabel.lineBreakMode = UILineBreakModeClip;// NSLineBreakByClipping;

Because comments are folded up by default and sometimes get missed, I am elaborating on Greg's comment with an example.
Deprecation warnings are only printed if your Deployment Target is newer than the first deprecation of the API.
Example 1:
Using: [TWTweetComposeViewController canSendTweet]
Deprecation in Apple's document:NS_DEPRECATED(NA, NA, 5_0, 6_0)
Deployment Target: iOS 5.0
iOS SDK: 6.1
Warning: No
Example 2:
Using: [TWTweetComposeViewController canSendTweet]
Deprecation in Apple's document:NS_DEPRECATED(NA, NA, 5_0, 6_0)
Deployment Target: iOS 6.1
iOS SDK: 6.1
Warning: Yes
In Example1, the apple's deprecation document states that the api was introduced in iOS 5.0 and deprecated in iOS 6.0. So although my iOS SDK(xcode) was 6.1, I was not getting any warning since my deployment target was iOS 5.0 which would need that api.
In Example2, I changed my deployment target to iOS 6.1 and the warning started appearing.
Conclusion: Deployment target is generally the lowest iOS version that you want your app to support. If you set that to a version that's subsequent to the deprecation of an API, the warnings start showing up in Xcode

Related

How to check iOS 10 deprecated methods in Xcode 8?

My app uses UIUserNotificationSettings, which I noticed is deprecated in iOS 10. However Xcode isn't displaying a Buildtime deprecation error for this method. How can I make Xcode display these newly deprecated methods?
You're not seeing deprecated warnings because you're likely targeting an OS that's pre-10.0. If you wanted to see the warnings, change your deployment target to 10.0 and the 10.0 deprecation warnings will appear.

Static Library and deployment target issue

I am working on iphone app with deployment target 5.1.1 and now i am adding google ios sdk in my project. I am not giving this functionality to user who has iOS 5.1.1 in device.
But google iOS Sdk needs to set Other Linker flag (-ObjC) in build setting and it creates problem in iOS 5.1.1.
is there any way to set Other Linker flag conditionally? i need to give support for iOS 5.1.1.
I tried below steps but not able to run app in iOS 5.1.1.
At the end compiler will generate single binary. Whether you provide certain feature in iOS 5.1.1 or not does not matter to compiler. So if you need to set deployment target to iOS 5.1.1 then all the static libraries you link must also support that particular deployment target.
More details on ObjC flag

incompatible SDK for ARC with mac osx 10.10

I am getting annoying warning messages for my targets after upgrading to osx 10.10, and the latest xcode (I can't remember which actually triggered it)
e.g: Incompatible SDK for ARC in target ApplicationName: macosx
If I change it from 'latest' to '10.10' then I get the same error:
Incompatible SDK for ARC in target ApplicationName: macosx10.10
Everything works and compiles, but still warning. The code is mixed swift and objective C, with ARC. Anyone else had this issue?
I had some older SDKs (10.5 and 10.6) from previous xcode versions that I had saved, in the xcode SDKs directory, which seemed to cause this error. I deleted these and replaced them with fresh ones downloaded from the apple website and the error went away.
I have same problem. But I found a solution:
In the Build Settings turn off the "Objective-C Automatic Reference Counting" paramter.

iPhone 5.1 App using OpenCV crashes due to "nonatomic" not found

I'm developing an iOS App which targets iOS 5.1+. I'm using XCode 4.5 on Mac OS X 10.8 and I do own an iPhone 4 with iOS 5.1.1. The app needs OpenCV, which I have successfully built from sources according to a tutorial in the OpenCV-Documentation.
Here is what happens:
When I start up the application I get an exception:
dyld: Symbol not found: _objc_setProperty_nonatomic
The error does not occur with iOS 6, but with iOS 5.1 in both the simulator and on a real device.
What is that? Is it related to OpenCV? Does it have to do something with incompatibilities between iOS / the iPhone / XCode??
EDIT: My development target is set to 5.1. The Base SDK is 6.0. I copied an SDK für 4.3 (which is the lowest version that XCode 4.5 will support) from another Mac and set development target as well as the base SDK to 4.3. Did not work either (it did not even build then).
I did not an update, the project has been started from scratch using XCode 4.5 initially.
Meanwhile I also found a tip to use gnulibc++ instead of libc++, but that also resulted in that the project did not build at all.
I built a test project and found the same issue. OpenCV is being built with a deployment target of ios6, this is a known issue, and a fix is pending review, see https://github.com/Itseez/opencv/pull/70

Warning in XMPP classes on iOS 6

I am getting multiple warnings when I am trying to run my XMPP chat client on iOS 6
'dispatch_get_current_queue' is deprecated: first deprecated in iOS 6.0
Not sure how to fix these warnings. Is updated XMPP framework available for objective C compatible with iOS 6?
This was reported at the project page:
https://github.com/robbiehanson/XMPPFramework/issues/115
https://github.com/robbiehanson/XMPPFramework/pull/140
Someone uploaded a patch. Either give that a try, or just live with the warning until the patch is accepted.
You can fix the warning in the XMPPFramework with this line:
NSAssert(dispatch_get_specific(moduleQueueTag), #"Invoked on incorrect queue");