In my previous post, I explained how to fix the open GL Shader related crash on iOS 9. This crash was specifically occurring for apps using Cocos 2.1, the crash fix did work correctly on iOS8 and above. But the fix had introduced another crash on iOS7 devices. The crash report looked like this:
I investigated the issue for sometime and then I had my "duh!" moment. The code that fixes the crash on iOS 9 used the method "containsString" of NSString class to find whether string A contains string B (on line no 18).
The method "containsString" was only introduced in iOS 8 hence, it was not available on devices running iOS 7 and below. When the code tries to use that method it obviously crashes the app!
We changed the code to not use "containsString" and used "rangeOfString" instead. This method was supported on iOS 7 as well. The updated code looks like this:
Heres the fully updated code that works on all devices running iOS 7 and above.
Such a silly mistake this was!