Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a misnamed selector generate a compile time error

Tags:

People also ask

Which of the following will lead to a compile time error?

Detailed Solution. The correct answer is a Syntax error. The syntax error is a compile-time error.

What is compile time error with example?

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

What is a compile time error?

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.

What is the difference between compile time error and runtime error?

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.