How can I remove this warning?
The use of single equal is intentional. It seems I can skip this warning by changing the code to `if ((self = [super init])) {`. But I don't want a smartass suggestion engine to dictate my code :)
Can I turn off this particular warning somehow?
请先登录再写评论。
FWIW. Xcode 4 has the same warning. I did see a one liner (sed or perl I think) that did a search and replace to migrate from the older to new types - if you are interested. I'd just need to go dig it up.
That said, you can disable it using the standard inspection/intention mechanism.
When the caret is over the statement causing the warning:
Option-Return
Right arrow (on either Extract Assignment or Place parentheses around)
Return (on Disable inspection).
This will disable this type of checking in all situations, not just in an init method.
Alt+Enter | Right arrow | Disable Inspection ?
Great, folks! thanks :)