update for Xcode6 Beta4

Quick fix for the compiler error under Xcode6 Beta4, seems string.rangeOfString() returns optional result now.