ios - How XCode knows about name of function at compile time? -
I have written simple code to practice But as soon as I change the selector to line, < XCode starts issuing warning: All Xcode knows that someone Not a class, in system code or in your program, which declares a selector named 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);
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.
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
Post a Comment