Skip to content
利用runtime转发消息,防止因为unrecognized selector sent to instance导致的崩溃
Objective-C
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
UnRecognizedSelectorProtecter
.gitignore
LICENSE
README.md

README.md

LMProtecter

利用runtime转发消息,防止因为unrecognized selector sent to instance导致的崩溃

通过OC的消息发送机制,利用forwardingTargetForSelector方法对为实现的方法进行处理,转发给一个protecter对象,在protecter对象中对resolveInstanceMethodForSelector添加一个默认的实现,从而防止unrecognized selector sent to instance的崩溃错误。。

具体的解析可以看这里;

You can’t perform that action at this time.