Detailed Solution. The correct answer is a Syntax error. The syntax error is a compile-time error.
"A compile-time error is an error that occurs when a program is being compiled. Examples: syntax errors such as omitting a required semicolon, using an undeclared variable, using a keyword for the name of a variable." An oversight inside a programme that is certainly discovered with the compiling program.
As the name implies, compile time errors occur when the code is built, but the program fails to compile. In contrast, Java runtime errors occur when a program successfully compiles but fails to execute. If code doesn't compile, the program is entirely unable to execute.
A compile-time error generally refers to the errors that correspond to the semantics or syntax. A runtime error refers to the error that we encounter during the code execution during runtime. We can easily fix a compile-time error during the development of code.
In objective-c how can I make a misnamed selector generate a compile time error?
For example, say I have this
@selector(some_misnamed_func)
And my class has this member
-(void)some_func
I want the objective-c compiler to tell me that it can't find that function at compile time rather than generate a run-time exception only when that code is run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With