Use Methodswizzle to implement security checks for system methods such as arrays, dictionaries, and so on. Obviously can achieve the desired effect, but actually found that when the keyboard is displayed in the case of the home app into the background, and then click the app icon to switch back to the foreground occurs crash:
[Uikeyboardlayoutstar release]: message sent to deallocated instance
Uikeyboardlayoutstar is a view of the layout on the keyboard,
The whole project was built under ARC, and it was weird.
All of which mention the Durexkit principle is the same, the above mentioned reason is replaced Nsarray Objectatindex: Method,
The reason for my project, however, was to replace Nsmutablearray's Objectatindex: (Nsmutablearray and Nsarray objectatindex: all replaced, replaced Nsarray Objectatindex: The method does not cause crash)
Solution: Add non-arc support and overwrite the implementation
IOS [Uikeyboardlayoutstar release]: message sent to deallocated