How can I remove this warning?

http://f.augustl.com/images/pastebin/appCode%20warning%202011-04-06%20at%2021.45.40.png

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?

3 comments

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.

0

Alt+Enter | Right arrow | Disable Inspection ?

0

Please sign in to leave a comment.