iphone - Why doesn't [obj selectorNotDefined] cause a warning? -


i want this:

[myobject selectornotdefined]; 

will cause warning. there option make happen?

to more specific, when add code existing project:

nsobject *myobject = [[nsobject alloc] init]; [myobject selectornotdefined]; 

the compiler not invoke warning.

if create new project , add these lines invokes warning.

what's wrong existing project?

if write:

nsobject *myobject = [[nsobject alloc] init]; [myobject selectornotdefined]; 

you warning: myobject might not respond selector selectornotdefined

or can check: i

f([myobject respondsto:selector(selectornotdefined)]{  [myobject selectornotdefined]; //or [myobject performselector:(selectornotdefined) withobject:nil afterdelay:0];  } 

Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -