NSString stringWithFormat swizzled to allow missing format numbered args

后端 未结 2 1312
慢半拍i
慢半拍i 2020-12-12 03:45

Based on this SO question asked a few hours ago, I have decided to implement a swizzled method that will allow me to take a formatted NSString as the format arg

2条回答
  •  忘掉有多难
    2020-12-12 04:28

    Whoa there!

    Instead of screwing with a core method that you very probably will introduce subtle bugs into, instead just turn on "Static Analyzer" in your project options, and it will run every build - if you get the arguments wrong it will issue a compiler warning for you.

    I appreciate your desire to make the application more robust but I think it very likely that re-writing this method will more likely break your application than save it.

提交回复
热议问题