My iOS app was working and all of a sudden I\'m seeing this error: \"cannot combine with previous \'type-name\' declaration specifier\". Any ideas on what could be causing t
Likewise I had a typo in a random file in the project. It was just some plain text that was accidentally placed before a comment. My suggestion to fix/find it would be to put a ; just before the statement that is flagged. This then drew a warning to the errant text when I compiled.
I saw this error when there was some dead incomplete code in my file that I'd forgotten to take out. The compiler indicated the error at the start of a method at the return type, so I spent a lot of time looking at the method declaration and call. Turned out the incorrect typo was above the method. since there was no ";" the compiler could only tell that the void keyword was misplaced.
I had this same problem. It turns out I had a typo in my main.m
file. Once I cleared that up, this error went away.
I get the same problem. And I finally fix it after cleaning some junk text at the bottom of my .h file. you may try.
I got it in a header file when in fact the error was in the .cpp. Turns out I had a method trying to return a bool in a sketchy way:
return (x == 1 && y == 2);
Which it turns out doesn't work, but Xcode told me in this very obscure way.
Not sure if this helps, but it's another example in a seeming desert of them.
It's one of the disadvantages of Xcode. Xcode is one of the worst IDE's ever, Apple is trying to make it better every update. But this issue raises when you add "Some word" in some places that the compiler of Xcode is not looking at it.
My case was like in image :
I forgot to delete the word RESideMenu in AppDelegate.h and the strange thing that Xcode accepts the code until the Build and when it fires error it rays it in another and not related class.