Re: Incompatible pointer type assigning to Warning
Re: Incompatible pointer type assigning to Warning
- Subject: Re: Incompatible pointer type assigning to Warning
- From: Roland King <email@hidden>
- Date: Fri, 27 May 2016 18:58:18 +0800
well it exists somewhere, in a library which isn’t cleaned or a header file which was copied over and not deleted. Xcode doesn’t insert things it vaguely remembers into the build just for giggles and grins, it compiles the code there is with a load of paths and includes, that’s all. If you look at the command line it’s using to compile the file, that will tell you every place it’s trying to get stuff from. You can hunt it down by using that list of paths, you can use find and grep on the DerivedData directory to find it, you can copy the command line to an xterm and run it and start taking bits out until it stops giving you that error and see what the last one is.
All the build stuff is in one place, well unless you change the build options to move it somewhere else, it’s all in DerivedData. find + grep on that directory would track down anything with the old name in it.
find . -type f -exec grep -i LTWGadgetZ {} \; -ls
There are no hidden menu options, there is an option to clean the Build Directory, which is in the same place that the option to clean the project is, you just hold down option to get the alternate menu, which is an OSX standard. In the Projects window is a button to delete derived data for any given project, that does a pretty good nuking, and then starts rebuilding it again for you shortly after.
Or you close Xcode, you delete DerivedData, the whole thing, and you open Xcode again and you build from there. Fairly drastic, but something you used to have to do back in the early Swift days so something I’m reasonably comfortable doing.
> On 27 May 2016, at 18:18, Dave <email@hidden> wrote:
>
> Hi,
>
>> The compiler doesn’t know which method you’re actually calling, and has no way of disambiguating at compile time, so it has to assume that it is one or the other;
>
> There is no one or the other LTWGadgetZ is not part of the project and the .h and .m files for it have been deleted. It used to use LTWGadgetZ it nows uses LTWGadgetX.
>
> When it worked without warning, it imported LTWGadgetZ.h, it now imports LTWGadgetZ.h. I’ve done a global search and removed all occurrences of LTWGadgetZ.h and I’ve cleaned the project and build folder yet it still thinks LTWGadgetZ exists!
>
>> in this case, it’s assuming that it’s LTWGadgetZ. (i.e. it’s not a matter of it “remembering” old code, the selection is more or less arbitrary). In this case, You have several options:
>
> LTWGadgetZ doesn’t exist anywhere, it used to exist and its mentioning it, so I’d call that “remembering”…..
>
>> - Cast (i.e. myGadgetX = (LTWGadgetX *)[myClass newGadgetInfo])
>> - Change +newGadgetInfo to return id
>> - Use “id” for myGadgetX’s type
>> - Use a common superclass of LTWGadgetX and LTWGadgetZ for myGadgetX’s type
>> - Make a protocol to which LTWGadgetX and LTWGadgetZ both conform, that declares the methods they have in common, and use “id<ThatProtocol>” for myGadgetX’s type
>
>
> I know how to fix it, the point is it shouldn’t be warning me because LTWGadgetZ does not exist except in XCode’s (and my) “memory”.
>
> This problem was fixed when I did a restart so I’m guessing it was stored in a Cache File which wasn’t cleared correctly when LTWGadgetZ was deleted from the project and file system.
>
> There used to be a “Clear Caches” option which used to fix problems like this, does anyone know if that command is hidden anywhere or which folder I have to zap in order to clear them?
>
> Cheers
> Dave
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden