Reputation: 973
My client has an old Obj-C based iOS project and wanted me to update it.
The problem is, on my computer, the project is clean of warnings. But on his computer, Xcode is showing 130+ Block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior
warnings.
I want to push the project warning-free, but cannot see/show/re-create them on my Mac.
Any suggestions? Thank you.
Notes:
Upvotes: 1
Views: 2108
Reputation: 131
Xcode 9.3 (9E145) will set the CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF to YES as part of it's "update project settings" step.
Also, Cocoapod depends on a gem called Xcodeproj and starting with version 1.5.5 (I think) Xcodeproj will also set this flag to YES for each pod target by default. (Note that you can be using the same version of Cocoapods with different versions of Xcodeproj and get different results when you run pod install/update).
You can force these errors to show up by manually setting this flag to YES for each build target (do this in Build Settings, search for "Implicit retain" - the entry is labeled "Implicit retain of 'self' within blocks" and it maps to the Clang flag CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF).
If you are using the same versions of Xcode I suspect you have different versions of Cocoapods (or Xcodeproj). Note that these warnings may be coming from the pods and not your code.
Upvotes: 2
Reputation: 973
Very much thanks to @staticVoidMan, -I don't know why and who did that. I'm the 3rd developer of the project- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF was set to NO. Setting it to YES show me the warnings.
The interesting part is my client cloned my project and in his project, it's set to YES. Odd. Whatever. It is solved.
Upvotes: 1