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
Post a Comment