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?

Comment actions Permalink

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:
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.

Comment actions Permalink

Alt+Enter | Right arrow | Disable Inspection ?

Comment actions Permalink

Great, folks! thanks :)


Please sign in to leave a comment.