Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to determine unused functions in Xcode4?

I know that functions can be called dynamically, but is there a way to determine statically which functions (and methods of ObjC objects) are not being called?

like image 611
AWF4vk Avatar asked Oct 10 '22 05:10

AWF4vk


1 Answers

I'm not sure that this is a sensible thing for someone to have attempted to make such a static analysis tool - it would be very complicated, and you would probably find that it would only find trvial examples of functions that would not be called - e.g. functions you've created in your classes, and you have no calls to them. All the stuff that interacts with Cocoa ... well the problem is that they 'might' be called in different circumstances.

In any case, what you should really be interested in is runtime code coverage - as this would show you (with a decent suite of tests) what code is actually being used, which would be a smaller subset.

like image 177
iandotkelly Avatar answered Oct 18 '22 12:10

iandotkelly