ios - Suppress "undeclared selector" warning in Xcode 5 -


i have parent view controller , child view controller. in child view controller's view, have uibutton called "startbutton". button, have added target below

[startbutton addtarget:[self parentviewcontroller] action:@selector(test:) forcontrolevents:uicontroleventtouchupinside]; 

i have implemented, test: method in parent controller , works fine me. when button tapped, event passed child view controller parent view controller , code snippets within test: method gets executed.

but problem is, getting warning message, "undeclared selector test:". know, getting because test: not implemented in child view controller implementation file.

is there way suppress warning alone? of suggestions have seen here makes entire warnings suppressed want suppress above mentioned warning alone.

thanks

if know sure you've done right thing, , code works fine, can stop xcode warning surrounding method with #pragma clang preprocessor commands.

for example:

#pragma clang diagnostic push #pragma clang diagnostic ignored "-wundeclared-selector"  [startbutton addtarget:[self parentviewcontroller] action:@selector(test:) forcontrolevents:uicontroleventtouchupinside];   #pragma clang diagnostic pop 

any 'missing messages' between push , pop commands not reported xcode. suggest having little code possible between them prevent real problems in code being unreported.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -