ios - How XCode knows about name of function at compile time? -


I have written simple code to practice selector in the objective code, which is working fine Is

  NSMutableArray * array = [NSMutableArray arrayWithObjects: @ "A", @ "b", zero]; NSLog (array before joining @ @% @); SEL message = @Selector (addObject :); // I will change this line if ([AR gives feedback: Troubleshooting: message]) {[ARAC displayer: with message Object: @ "c"];} NSLog (@ "% @ after adding", array);   

But as soon as I change the selector to line, < XCode starts issuing warning: > SEL message = @selector (addobject :); // just rename the selector's name

undeclared selector 'A Now, the question is, how does XCode compile the name of the name about the time is correct or does not always generate the list of the selector internally, whatever I made. Codex> NSMutableArray

All Xcode knows that someone Not a class, in system code or in your program, which declares a selector named addobject , you can prove it by creating a custom class Which declares a addobject method, and warnings must be removed, but the program will definitely crash with an unrecognized selector sent to the object error message.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -