I have a class exposing some methods, whose implementation is provided by an inner object.
I'm using forward invocation to dispatch at runtime the method calls to the inner object, but XCode is complaining since it cannot find an implementation of the declared methods.
I found some other similar questions on SO, but all of them were solved with a design change.
I don't mean to have a discussion about the design here, but if anybody has some suggestion about it I have an open question on Code Review, which is more suitable for such kind of discussions.
My question is here is whether a method to turn off the Incomplete Implementation
warning in XCode exists.
You can declare the methods in a class category interface:
(without an implementation for the category). Then Xcode will not complain about "incomplete implementation" anymore.
You can suppress
Incomplete Implementation
warnings by addingjust above the
@implementation
Hope this helps
EDIT
After being told in the comments that this didn't work for someone and finding out the reason was because it was a different warning they were getting I have done a bit of playing around and been able to solve there issue to so I thought I would update this answer to include theirs and for
GCC
ignores as well. So for the issue for@Tony
the following should workFor anyone wanting to know the
GCC
compiler version it isI will also make a point that all these
diagnotstic ignores
can also be done by specifying the setting on a per file basis by going toXCODE Project >> Target >> Build Phases >> Compile Sources
and adding a compiler-flag so you would just add-Wprotocol
orWincomplete-implementation
or whatever compiler-flag you needed.Hope this update helps all if anymore need I will update my answer to include.
EDIT 2
I was doing a bit more digging around about this an came across the Clang Compliler User's Manual so I thought that this would be interesting and helpful to anyone having issues around this area still.
I have also found another way that you can use these
#pragma diagnostic ignores
and that is you canpush
andpop
them so if you wanted to just ignore a particular section of the file and not all of it then you could do the followingRemember that all these
#pragma
compile ignores can be used withGCC
as well so the above wouldThe
push
andpop
seem to work with all thediagnostic ignores
I have tried so far.Another one is
The one for suppressing unused variables is
and the GCC version being
A few more for ignoring warnings from unavailableInDeploymentTarget
and performSelector leaks
and deprecated declarations
Thanks to
DanSkeel
you can find the entire list here