objective c - forwardInvocation vs class_addMethod -


in implementation, have choice of using class_addmethod create new methods in runtime, or can rely on forwardinvocation/nsproxy. when both approaches available solutions, way prefer , how determine?

i prefer class_addmethod.

  1. because much faster forwardinvocation (search method list, try forwardtarget, create nsinvocation, last attempt resolve selector)
  2. it more clear add new method rather handle dynamical method call in 1 place.

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -